Skip to content

Commit

Permalink
added variable elements to help with black code formatting issue, due…
Browse files Browse the repository at this point in the history
… to lines being too long with the new as_file(files(... paradigm needed
  • Loading branch information
azaidi06 committed Dec 13, 2024
1 parent 48b596e commit 02c1b49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions idaes/apps/grid_integration/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def data_path(self) -> Path:
# where importlib.resources.path() requires the resource to be a file
# directories are not supported and will raise an error if attempted

with as_file(files("idaes.tests.prescient.5bus").joinpath("__init__.py")) as pkg_file:
fname = "idaes.tests.prescient.5bus"
py_fname = "__init__.py"
with as_file(files(fname).joinpath(py_fname)) as pkg_file:
prescient_5bus = Path(pkg_file).parent


Expand All @@ -73,7 +75,9 @@ def self_scheduler_output_dir(self, tmp_path: Path) -> Path:

@pytest.fixture
def self_scheduler_plugin_path(self) -> Path:
with as_file(files("idaes.apps.grid_integration.tests").joinpath("self_scheduler_integration_test_plugin.py")) as p:
fname = "idaes.apps.grid_integration.tests"
py_fname = "self_scheduler_integration_test_plugin.py"
with as_file(files(fname).joinpath(py_fname)) as p:
return Path(p)

@pytest.mark.unit
Expand Down
4 changes: 3 additions & 1 deletion idaes/tests/prescient/test_prescient.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +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
with as_file(files("idaes.tests.prescient.5bus").joinpath("__init__.py")) as pkg_file:
fname = "idaes.tests.prescient.5bus"
py_fname = "__init__.py"
with as_file(files(fname).joinpath(py_fname)) as pkg_file:
prescient_5bus = Path(pkg_file).parent

@pytest.mark.unit
Expand Down

0 comments on commit 02c1b49

Please sign in to comment.