From a2630ce9391d9bf26ef9f1263fc5fc2827178dd7 Mon Sep 17 00:00:00 2001 From: GabrielBarberini Date: Thu, 7 Mar 2024 19:18:33 -0300 Subject: [PATCH] TST: Adds request finalizer as teardown for unit env --- tests/unit/test_environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_environment.py b/tests/unit/test_environment.py index cc3c98675..8504cee46 100644 --- a/tests/unit/test_environment.py +++ b/tests/unit/test_environment.py @@ -94,7 +94,7 @@ def test_location_set_topographic_profile_computes_elevation( assert computed_elevation == theoretical_elevation -def test_environment_export_environment_exports_environment_json(example_spaceport_env): +def test_environment_export_environment_exports_environment_json(example_spaceport_env, request): """Tests the export_environment() method of the Environment class. Parameters @@ -103,7 +103,7 @@ def test_environment_export_environment_exports_environment_json(example_spacepo """ assert example_spaceport_env.export_environment(filename="environment") == None assert os.path.isfile("environment.json") - example_spaceport_env.addfinalizer(os.remove("environment.json")) + request.addfinalizer(os.remove("environment.json")) def test_geodesic_coordinate_geodesic_to_utm_converts_coordinate():