Skip to content

Commit

Permalink
Changing test function scopes to ensure a proper reset of scheduler.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Nov 17, 2023
1 parent 6448a4f commit 5cd07d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/scheduler/test_dispatch_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def constraints():
return [MoonAvoidance(), Duration(30 * u.deg)]


@pytest.fixture
@pytest.fixture(scope='function')
def observer():
loc = get_config('location')
location = EarthLocation(lon=loc['longitude'], lat=loc['latitude'], height=loc['elevation'])
return Observer(location=location, name="Test Observer", timezone=loc['timezone'])


@pytest.fixture()
@pytest.fixture(scope='function')
def field_file():
scheduler_config = get_config('scheduler', default={})

Expand All @@ -37,7 +37,7 @@ def field_file():
return fields_path


@pytest.fixture()
@pytest.fixture(scope='function')
def field_list():
return yaml.full_load("""
-
Expand Down Expand Up @@ -251,7 +251,7 @@ def test_observed_list(scheduler):
assert len(scheduler.observed_list) == 1

# A few hours later should now be different
time = Time('2016-09-11 14:08:00')
time = Time('2016-09-11 10:08:00')
scheduler.get_observation(time=time)
assert len(scheduler.observed_list) == 2

Expand Down

0 comments on commit 5cd07d4

Please sign in to comment.