Skip to content

Commit

Permalink
Use tmp_path fixture instead of Path.cwd() to save a file so that…
Browse files Browse the repository at this point in the history
… it gets cleaned up
  • Loading branch information
WilliamJamieson committed Nov 4, 2024
1 parent 63d5280 commit 6afe5d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_tweakreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def datamodel(wcsobj2, group_id=None):
return MinimalDataWithWCS(wcsobj2, group_id=group_id)


def test_parse_refcat(datamodel):
def test_parse_refcat(datamodel, tmp_path):

wcsobj = datamodel.meta.wcs
correctors = fake_correctors(0.0)
Expand All @@ -216,11 +216,11 @@ def test_parse_refcat(datamodel):
catalog=TEST_CATALOG)

# save refcat to file
cat.write(Path.cwd() / CATALOG_FNAME, format="ascii.ecsv", overwrite=True)
cat.write(tmp_path / CATALOG_FNAME, format="ascii.ecsv", overwrite=True)

# parse refcat from file
epoch = Time(datamodel.meta.observation.date).decimalyear
refcat = _parse_refcat(Path.cwd() / CATALOG_FNAME,
refcat = _parse_refcat(tmp_path / CATALOG_FNAME,
correctors,
datamodel.meta.wcs,
datamodel.meta.wcsinfo,
Expand Down

0 comments on commit 6afe5d5

Please sign in to comment.