diff --git a/idaes/apps/grid_integration/tests/test_integration.py b/idaes/apps/grid_integration/tests/test_integration.py index 3de0101920..1d9dfd2c62 100644 --- a/idaes/apps/grid_integration/tests/test_integration.py +++ b/idaes/apps/grid_integration/tests/test_integration.py @@ -50,13 +50,11 @@ def data_path(self) -> Path: # we need to specify __init__.py as a workaround for Python 3.9, # where importlib.resources.path() requires the resource to be a file # directories are not supported and will raise an error if attempted - - fname = "idaes.tests.prescient.5bus" - py_fname = "__init__.py" - with as_file(files(fname).joinpath(py_fname)) as pkg_file: + with as_file( + files("idaes.tests.prescient.5bus").joinpath("__init__.py") + ) as pkg_file: prescient_5bus = Path(pkg_file).parent - @pytest.mark.unit def test_data_path_available(self, data_path: Path): assert data_path.is_dir() @@ -75,9 +73,11 @@ def self_scheduler_output_dir(self, tmp_path: Path) -> Path: @pytest.fixture def self_scheduler_plugin_path(self) -> Path: - fname = "idaes.apps.grid_integration.tests" - py_fname = "self_scheduler_integration_test_plugin.py" - with as_file(files(fname).joinpath(py_fname)) as p: + with as_file( + files("idaes.apps.grid_integration.tests").joinpath( + "self_scheduler_integration_test_plugin.py" + ) + ) as p: return Path(p) @pytest.mark.unit diff --git a/idaes/tests/prescient/test_prescient.py b/idaes/tests/prescient/test_prescient.py index 7ef1c71801..c1c6f125b8 100644 --- a/idaes/tests/prescient/test_prescient.py +++ b/idaes/tests/prescient/test_prescient.py @@ -33,9 +33,9 @@ def data_path(self) -> Path: # we need to specify __init__.py as a workaround for Python 3.9, # where importlib.resources.path() requires the resource to be a file # directories are not supported and will raise an error if attempted - fname = "idaes.tests.prescient.5bus" - py_fname = "__init__.py" - with as_file(files(fname).joinpath(py_fname)) as pkg_file: + with as_file( + files("idaes.tests.prescient.5bus").joinpath("__init__.py") + ) as pkg_file: prescient_5bus = Path(pkg_file).parent @pytest.mark.unit