From 6afe5d5c77719954cf2ae42204f023b0cdeec1a9 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Mon, 4 Nov 2024 11:29:30 -0500 Subject: [PATCH] Use `tmp_path` fixture instead of `Path.cwd()` to save a file so that it gets cleaned up --- tests/test_tweakreg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_tweakreg.py b/tests/test_tweakreg.py index 10008a5f5..335c62c68 100644 --- a/tests/test_tweakreg.py +++ b/tests/test_tweakreg.py @@ -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) @@ -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,