Skip to content

Commit 1aeb6c5

Browse files
committed
Fix a few more .root places to .root_path
1 parent f71df38 commit 1aeb6c5

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

exasol/toolbox/nox/_test.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ def _test_command(
2222
path: Path, config: Config, context: MutableMapping[str, Any]
2323
) -> Iterable[str]:
2424
coverage_command = (
25-
["coverage", "run", "-a", f"--rcfile={config.root / 'pyproject.toml'}", "-m"]
25+
[
26+
"coverage",
27+
"run",
28+
"-a",
29+
f"--rcfile={config.root_path / 'pyproject.toml'}",
30+
"-m",
31+
]
2632
if context["coverage"]
2733
else []
2834
)
@@ -33,7 +39,7 @@ def _test_command(
3339
def _unit_tests(
3440
session: Session, config: Config, context: MutableMapping[str, Any]
3541
) -> None:
36-
command = _test_command(config.root / "test" / "unit", config, context)
42+
command = _test_command(config.root_path / "test" / "unit", config, context)
3743
session.run(*command)
3844

3945

@@ -49,7 +55,7 @@ def _integration_tests(
4955
# - Catch exceptions and ensure post-hooks run before exiting
5056
# - Consider making the executed command(s) configurable via a plugin hook
5157
# (The default implementation of the hook could provide the current implementation)
52-
command = _test_command(config.root / "test" / "integration", config, context)
58+
command = _test_command(config.root_path / "test" / "integration", config, context)
5359
session.run(*command)
5460

5561
# run post integration test plugins
@@ -67,7 +73,7 @@ def _coverage(
6773
session: Session, config: Config, context: MutableMapping[str, Any]
6874
) -> None:
6975
command = ["coverage", "report", "-m"]
70-
coverage_file = config.root / ".coverage"
76+
coverage_file = config.root_path / ".coverage"
7177
coverage_file.unlink(missing_ok=True)
7278
_unit_tests(session, config, context)
7379
_integration_tests(session, config, context)

test/unit/nox/_package_check_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def test_works_as_expected(nox_session):
1919
package_check(nox_session)
2020

2121
@staticmethod
22-
def test_raises_non_zero_exist_with_readme_error(nox_session, tmp_path):
22+
def test_raises_non_zero_exist_with_readme_error(
23+
nox_session, test_project_config_factory, tmp_path
24+
):
2325
package = Path(tmp_path)
2426
package_readme = package / "README.rst"
2527

@@ -40,8 +42,10 @@ def test_raises_non_zero_exist_with_readme_error(nox_session, tmp_path):
4042

4143
# use of the folder with errors in the nox -s package:check function
4244
with pytest.raises(CommandFailed) as e:
43-
with patch("exasol.toolbox.nox._package.PROJECT_CONFIG") as config:
44-
config.root = package
45+
with patch(
46+
"exasol.toolbox.nox._package.PROJECT_CONFIG",
47+
new=test_project_config_factory(),
48+
):
4549
package_check(nox_session)
4650
# verify broken with non-zero exit status
4751
assert str(e.value) == "Returned code 1"

0 commit comments

Comments
 (0)