@pytest.mark.parametrize('jobstore', [None, 'alter', 'third'],
                             ids=['all', 'single jobstore', 'nonexistent store'])
    def test_remove_all_jobs(self, scheduler, jobstore):
        scheduler._jobstores = OrderedDict([
            ('default', MagicMock(BaseJobStore)),
            ('alter', MagicMock(BaseJobStore))
        ])
        scheduler._pending_jobs = [
            (MagicMock(Job), 'default', False),
            (MagicMock(Job), 'alter', False),
            (MagicMock(Job), 'third', False)
        ]
        scheduler._dispatch_event = MagicMock()
        scheduler.remove_all_jobs(jobstore)

        if jobstore == 'alter':
            scheduler._jobstores['alter'].remove_all_jobs.assert_called_once_with()
            assert scheduler._jobstores['default'].remove_all_jobs.call_count == 0
            assert len(scheduler._pending_jobs) == 2
        elif jobstore == 'third':
            assert scheduler._jobstores['alter'].remove_all_jobs.call_count == 0
            assert scheduler._jobstores['default'].remove_all_jobs.call_count == 0
            assert len(scheduler._pending_jobs) == 2
        else:
            scheduler._jobstores['alter'].remove_all_jobs.assert_called_once_with()
            scheduler._jobstores['default'].remove_all_jobs.assert_called_once_with()
            assert len(scheduler._pending_jobs) == 0

        assert scheduler._dispatch_event.call_count == 1
        event = scheduler._dispatch_event.call_args[0][0]
        assert event.code == EVENT_ALL_JOBS_REMOVED
        assert event.alias == jobstore
Tests that remove_all_jobs() removes all jobs from all attached
dataset/ETHPy150Open agronholm/apscheduler/tests/test_schedulers.py/TestBaseScheduler.test_remove_all_jobs