diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index b9a20bf05..6d337da01 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -2,10 +2,19 @@ ## Summary -Raised the minimum supported Python version from 3.11 to 3.11.5, as later versions of -`soupsieve` no longer support earlier patch releases and the vulnerability in -`soupsieve` for Python 3.11 could not otherwise be resolved. +In this major release, we: + +* Dropped the Nox sessions `test:coverage` and `project:check` +* Modified the Nox sessions `test:unit` and `test:integration` to accept one or more + files or directories via `--paths` +* Raised the minimum supported Python version from 3.11 to 3.11.5, as later versions of + `soupsieve` no longer support earlier patch releases and the vulnerability in + `soupsieve` for Python 3.11 could not otherwise be resolved. ## Refactoring * #998: Raised `requires-python` to `>=3.11.5,<4.0` +* #939: + * Removed Nox session `test:coverage` + * Removed Nox session `project:check` + * Modified Nox sessions `test:unit` and `test:integration` to accept one or more files or directories via `--paths`, overriding the default test directory diff --git a/doc/user_guide/features/index.rst b/doc/user_guide/features/index.rst index b31dfe9f7..b5cba2c14 100644 --- a/doc/user_guide/features/index.rst +++ b/doc/user_guide/features/index.rst @@ -42,7 +42,6 @@ Use :code:`nox -l` to show the current list of sessions for your project Common examples are as follows: * :code:`nox -s format:fix` applies formatting changes. -* :code:`nox -s project:check` runs the main local quality gate. * :code:`nox -s test:unit` runs unit tests. * :code:`nox -s workflow:generate -- all` updates PTB workflow files. diff --git a/exasol/toolbox/nox/_shared.py b/exasol/toolbox/nox/_shared.py index c897e990d..7a49cb689 100644 --- a/exasol/toolbox/nox/_shared.py +++ b/exasol/toolbox/nox/_shared.py @@ -1,18 +1,10 @@ from __future__ import annotations -import argparse -from collections import ChainMap -from collections.abc import ( - MutableMapping, -) from enum import ( Enum, auto, ) from pathlib import Path -from typing import Any - -from nox import Session from noxconfig import ( PROJECT_CONFIG, @@ -53,55 +45,3 @@ def validate_path_within_root(path: Path) -> Path: ) return resolved_path - - -def _context_parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser( - formatter_class=argparse.ArgumentDefaultsHelpFormatter - ) - return parser - - -def _context( - session: Session, - parser: argparse.ArgumentParser, - default_context: dict[str, Any], - **kwargs: Any, -) -> MutableMapping[str, Any]: - namespace, args = parser.parse_known_args(session.posargs) - cli_context: MutableMapping[str, Any] = vars(namespace) - cli_context["fwd-args"] = args - # Note: ChainMap scans last to first - return ChainMap(kwargs, cli_context, default_context) - - -def _unit_test_context(session: Session, **kwargs: Any) -> MutableMapping[str, Any]: - parser = _context_parser() - parser.add_argument( - "--coverage", action="store_true", help="Enable the collection of coverage data" - ) - return _context(session, parser, {"coverage": False}, **kwargs) - - -def _integration_test_context( - session: Session, - **kwargs: Any, -) -> MutableMapping[str, Any]: - parser = _context_parser() - parser.add_argument( - "--coverage", action="store_true", help="Enable the collection of coverage data" - ) - parser.add_argument( - "--db-version", - default=PROJECT_CONFIG.minimum_exasol_version, - help="Specify the Exasol DB version to be used", - ) - return _context( - session, - parser, - { - "coverage": False, - "db_version": PROJECT_CONFIG.minimum_exasol_version, - }, - **kwargs, - ) diff --git a/exasol/toolbox/nox/_test.py b/exasol/toolbox/nox/_test.py index db6f9c4f8..1c9d60ffa 100644 --- a/exasol/toolbox/nox/_test.py +++ b/exasol/toolbox/nox/_test.py @@ -1,104 +1,133 @@ from __future__ import annotations +import argparse from collections.abc import ( Iterable, - MutableMapping, ) +from dataclasses import dataclass from pathlib import Path -from typing import Any import nox from nox import Session from exasol.toolbox.config import BaseConfig -from exasol.toolbox.nox._shared import ( - _integration_test_context, - _unit_test_context, -) from exasol.toolbox.nox.plugin import NoxTasks -from noxconfig import ( - PROJECT_CONFIG, -) +from noxconfig import PROJECT_CONFIG + +UNIT_TESTS_DIRECTORY = PROJECT_CONFIG.root_path / "test" / "unit" +INTEGRATION_TESTS_DIRECTORY = PROJECT_CONFIG.root_path / "test" / "integration" + + +@dataclass +class ArgparseResults: + """ + Records the results from the parsed session parameters. + Argparse separates these based on which arguments are expected (`known`) + and which are unknown (`other`). + """ + + known: argparse.Namespace + other: list[str] + + +def _unit_test_context(session: Session) -> ArgparseResults: + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument( + "--paths", + nargs="+", + type=Path, + default=[UNIT_TESTS_DIRECTORY], + help="Paths (files or directories) to be tested", + ) + parser.add_argument( + "--coverage", action="store_true", help="Enable the collection of coverage data" + ) + return ArgparseResults(*parser.parse_known_args(session.posargs)) + + +def _integration_test_context(session: Session) -> ArgparseResults: + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument( + "--paths", + nargs="+", + type=Path, + default=[INTEGRATION_TESTS_DIRECTORY], + help="Paths (files or directories) to be tested", + ) + parser.add_argument( + "--coverage", action="store_true", help="Enable the collection of coverage data" + ) + parser.add_argument( + "--db-version", + default=PROJECT_CONFIG.minimum_exasol_version, + help="Specify the Exasol DB version to be used", + ) + return ArgparseResults(*parser.parse_known_args(session.posargs)) def _test_command( - path: Path, config: BaseConfig, context: MutableMapping[str, Any] + config: BaseConfig, argparse_results: ArgparseResults ) -> Iterable[str]: - coverage_command = ( - [ + coverage_command = [] + if argparse_results.known.coverage: + coverage_command = [ "coverage", "run", "-a", f"--rcfile={config.root_path / 'pyproject.toml'}", "-m", ] - if context["coverage"] - else [] + return ( + coverage_command + + ["pytest", *argparse_results.known.paths] + + argparse_results.other ) - pytest_command = ["pytest", "-v", f"{path}"] - return coverage_command + pytest_command + context["fwd-args"] - - -def _unit_tests( - session: Session, config: BaseConfig, context: MutableMapping[str, Any] -) -> None: - command = _test_command(config.root_path / "test" / "unit", config, context) - session.run(*command) def _integration_tests( - session: Session, config: BaseConfig, context: MutableMapping[str, Any] + session: Session, config: BaseConfig, argparse_results: ArgparseResults ) -> None: pm = NoxTasks.plugin_manager(config) # run pre integration test plugins - pm.hook.pre_integration_tests_hook(session=session, config=config, context=context) + pm.hook.pre_integration_tests_hook( + session=session, config=config, context=argparse_results + ) # Notes: # - Catch exceptions and ensure post-hooks run before exiting # - Consider making the executed command(s) configurable via a plugin hook # (The default implementation of the hook could provide the current implementation) - command = _test_command(config.root_path / "test" / "integration", config, context) + command = _test_command(config, argparse_results) session.run(*command) # run post integration test plugins - pm.hook.post_integration_tests_hook(session=session, config=config, context=context) - - -def _coverage( - session: Session, config: BaseConfig, context: MutableMapping[str, Any] -) -> None: - command = ["coverage", "report", "-m"] - coverage_file = config.root_path / ".coverage" - coverage_file.unlink(missing_ok=True) - _unit_tests(session, config, context) - _integration_tests(session, config, context) - session.run(*command) + pm.hook.post_integration_tests_hook( + session=session, config=config, context=argparse_results + ) @nox.session(name="test:unit", python=False) def unit_tests(session: Session) -> None: """Runs all unit tests""" - context = _unit_test_context(session) - _unit_tests(session, PROJECT_CONFIG, context) + argparse_results = _unit_test_context(session) + command = _test_command(PROJECT_CONFIG, argparse_results) + session.run(*command) @nox.session(name="test:integration", python=False) def integration_tests(session: Session) -> None: """ - Runs the all integration tests + Runs all integration tests If a project needs to execute code pre-/post the test execution, it should provide appropriate hooks on their config object. - * pre_integration_tests_hook(session: Session, config: Config, context: MutableMapping[str, Any]) -> bool: - * post_integration_tests_hook(session: Session, config: Config, context: MutableMapping[str, Any]) -> bool: + * pre_integration_tests_hook + * post_integration_tests_hook """ - context = _integration_test_context(session) - _integration_tests(session, PROJECT_CONFIG, context) - - -@nox.session(name="test:coverage", python=False) -def coverage(session: Session) -> None: - """Runs all tests (unit + integration) and reports the code coverage""" - context = _integration_test_context(session, coverage=True) - _coverage(session, PROJECT_CONFIG, context) + argparse_results = _integration_test_context(session) + _integration_tests(session, PROJECT_CONFIG, argparse_results) diff --git a/exasol/toolbox/nox/tasks.py b/exasol/toolbox/nox/tasks.py index c298f85fd..886c70e91 100644 --- a/exasol/toolbox/nox/tasks.py +++ b/exasol/toolbox/nox/tasks.py @@ -3,9 +3,7 @@ __all__ = [ "Mode", "build_docs", - "check", "clean_docs", - "coverage", "fix_format", "integration_tests", "lint", @@ -32,19 +30,9 @@ from noxconfig import PROJECT_CONFIG -@nox.session(name="project:check", python=False) -def check(session: Session) -> None: - """Runs all available checks on the project""" - context = _integration_test_context(session, coverage=True) - py_files = get_filtered_python_files(PROJECT_CONFIG.root_path) - _code_format(session, Mode.Check, py_files) - _pylint(session, py_files) - _type_check(session, py_files) - _coverage(session, PROJECT_CONFIG, context) + from exasol.toolbox.nox._test import ( - _coverage, - coverage, integration_tests, unit_tests, ) @@ -64,7 +52,6 @@ def check(session: Session) -> None: from exasol.toolbox.nox._skills import check_skills, install_skills from exasol.toolbox.nox._shared import ( Mode, - _integration_test_context, get_filtered_python_files, ) diff --git a/exasol/toolbox/skills/exasol-python-toolbox/references/common-workflows.md b/exasol/toolbox/skills/exasol-python-toolbox/references/common-workflows.md index f08b2569e..1f9db3be2 100644 --- a/exasol/toolbox/skills/exasol-python-toolbox/references/common-workflows.md +++ b/exasol/toolbox/skills/exasol-python-toolbox/references/common-workflows.md @@ -48,9 +48,6 @@ replace it with configuration, a plugin hook, or a PTB extension point later. 2. Read the related tool sections in `pyproject.toml`. 3. Make the requested code change, document change, or configuration change. 4. Run the smallest PTB session that checks the change. -5. Run `project:check` when the change affects shared operation. -6. Run `project:check` when the change affects release readiness. -7. Run `project:check` when the change affects CI operation. When you remove or rename a documentation file, update each Sphinx `toctree` that points to it. Then run `docs:build`. diff --git a/exasol/toolbox/skills/exasol-python-toolbox/references/nox-sessions.md b/exasol/toolbox/skills/exasol-python-toolbox/references/nox-sessions.md index 063b45d39..ccb12fc38 100644 --- a/exasol/toolbox/skills/exasol-python-toolbox/references/nox-sessions.md +++ b/exasol/toolbox/skills/exasol-python-toolbox/references/nox-sessions.md @@ -12,7 +12,6 @@ The sessions below match the PTB version that includes this skill. | Session | Use | Notes | | --- | --- | --- | -| `project:check` | Run large local checks or CI checks. | It runs format check, Pylint, Mypy, and coverage for unit and integration tests. | | `format:fix` | Apply Python format changes. | It runs pyupgrade, Ruff fixes, isort, and Black. | | `format:check` | Check Python format. | It runs Ruff check, isort check, and Black check. | | `lint:code` | Run static code analysis. | It runs Pylint on `PROJECT_CONFIG.source_code_path` and writes `.lint.json`. | @@ -32,7 +31,6 @@ The sessions below match the PTB version that includes this skill. | --- | --- | --- | | `test:unit` | Run unit tests. | It runs `pytest -v test/unit`. Put Pytest options after `--`; use `-k` to select tests by name. | | `test:integration` | Run integration tests. | It runs `pytest -v test/integration`. It supports PTB integration test hooks. | -| `test:coverage` | Run all tests with coverage. | It runs unit and integration tests with coverage. It prints `coverage report -m`. | Test command examples: diff --git a/exasol/toolbox/skills/exasol-python-toolbox/references/source-routing.md b/exasol/toolbox/skills/exasol-python-toolbox/references/source-routing.md index 185c714d6..3a64b31cc 100644 --- a/exasol/toolbox/skills/exasol-python-toolbox/references/source-routing.md +++ b/exasol/toolbox/skills/exasol-python-toolbox/references/source-routing.md @@ -36,8 +36,7 @@ Read the source file before you explain a detailed rule. - `exasol/toolbox/nox/_package.py`: package validation. - `exasol/toolbox/nox/_release.py`: release preparation, release update, and release trigger sessions. -- `exasol/toolbox/nox/_test.py`: `test:unit`, `test:integration`, and - `test:coverage`. +- `exasol/toolbox/nox/_test.py`: `test:unit` and `test:integration` - `exasol/toolbox/nox/_workflow.py`: workflow check, generation, and audit sessions. diff --git a/test/integration/project-template/nox_test.py b/test/integration/project-template/nox_test.py index 35da03ced..1dc0aae58 100644 --- a/test/integration/project-template/nox_test.py +++ b/test/integration/project-template/nox_test.py @@ -7,10 +7,8 @@ EXPECTED_NOX_SESSIONS = { "format:fix", "format:check", - "project:check", "test:unit", "test:integration", - "test:coverage", "lint:code", "lint:typing", "lint:security", diff --git a/test/resources/skills/exasol-python-toolbox/eval_cases.yml b/test/resources/skills/exasol-python-toolbox/eval_cases.yml index 42b2d0e68..0715ace73 100644 --- a/test/resources/skills/exasol-python-toolbox/eval_cases.yml +++ b/test/resources/skills/exasol-python-toolbox/eval_cases.yml @@ -34,7 +34,6 @@ cases: - ".pre-commit-config.yaml" - "pre-commit" - "pre-push" - - "project:check" - "nox-sessions.md" must_not_include: - "run Pytest directly" diff --git a/test/unit/nox/_shared_test.py b/test/unit/nox/_shared_test.py index fe1c17faa..eeccaf5dc 100644 --- a/test/unit/nox/_shared_test.py +++ b/test/unit/nox/_shared_test.py @@ -4,8 +4,6 @@ import pytest from exasol.toolbox.nox._shared import ( - _integration_test_context, - _unit_test_context, get_filtered_python_files, validate_path_within_root, ) @@ -32,7 +30,7 @@ def directories(test_project_config_factory, package_directory, excluded_python_ additional = { config.root_path / d for d in (package_directory, excluded_python_path) } - yield set(config.excluded_python_paths).union(additional) + return set(config.excluded_python_paths).union(additional) @pytest.fixture @@ -79,55 +77,6 @@ def test_get_filtered_python_files( assert "toolbox/sample.py" in exceptions[0] -def test_unit_test_context_help_excludes_db_version(nox_session): - captured: dict[str, str] = {} - - def _capture_context(session, parser, default_context, **kwargs): - captured["help_text"] = parser.format_help() - return default_context - - with patch("exasol.toolbox.nox._shared._context", side_effect=_capture_context): - _unit_test_context(nox_session) - - help_text = captured["help_text"] - assert "--coverage" in help_text - assert "--db-version" not in help_text - - -def test_integration_test_context_help_includes_db_version(nox_session): - captured: dict[str, str] = {} - - def _capture_context(session, parser, default_context, **kwargs): - captured["help_text"] = parser.format_help() - return default_context - - with patch("exasol.toolbox.nox._shared._context", side_effect=_capture_context): - _integration_test_context(nox_session) - - help_text = captured["help_text"] - assert "--coverage" in help_text - assert "--db-version" in help_text - - -def test_unit_test_context_has_no_db_version(nox_session): - context = _unit_test_context(nox_session) - - assert context["coverage"] is False - assert "db_version" not in context - - -def test_integration_test_context_uses_minimum_exasol_version( - nox_session, test_project_config_factory -): - config = test_project_config_factory(exasol_versions=("2025.1.8", "8.29.13")) - - with patch("exasol.toolbox.nox._shared.PROJECT_CONFIG", config): - context = _integration_test_context(nox_session) - - assert context["coverage"] is False - assert context["db_version"] == "8.29.13" - - class TestValidatePathWithinRoot: @staticmethod @pytest.mark.parametrize( diff --git a/test/unit/nox/_test_test.py b/test/unit/nox/_test_test.py index c44a347cd..83dacc3e6 100644 --- a/test/unit/nox/_test_test.py +++ b/test/unit/nox/_test_test.py @@ -1,45 +1,125 @@ -import shutil -from unittest.mock import patch +from argparse import Namespace +from pathlib import Path +from unittest.mock import ( + Mock, +) import pytest from exasol.toolbox.nox._test import ( + INTEGRATION_TESTS_DIRECTORY, + UNIT_TESTS_DIRECTORY, + ArgparseResults, + _integration_test_context, + _integration_tests, _test_command, - coverage, - integration_tests, - unit_tests, + _unit_test_context, ) +from exasol.toolbox.nox.plugin import hookimpl from noxconfig import PROJECT_CONFIG +PATH_CASES = [ + ([], []), + (["abc"], []), + (["abc", "def"], []), + ([], ["-s"]), + ([], ["-k", "TestClass"]), + (["abc"], ["-k", "TestClass"]), + (["abc", "def"], ["-v"]), +] -@pytest.fixture -def default_context(): - """ - The default context comes from `toolbox/nox/_shared.py::_context` - """ - return {"db_version": "8.29.13", "coverage": False, "fwd-args": []} +def _posargs(dirs, other): + if not dirs: + return other + return ["--paths", *dirs] + other -class TestTestCommand: + +class TestUnitTestContext: @staticmethod - def test_works_for_default_arguments(test_project_config_factory, default_context): - config = test_project_config_factory() + @pytest.mark.parametrize("dirs, other", PATH_CASES) + def test_paths_and_other_arguments(dirs, other): + result = _unit_test_context(Mock(posargs=_posargs(dirs, other))) + + assert result == ArgparseResults( + known=Namespace( + paths=[Path(d) for d in dirs] or [UNIT_TESTS_DIRECTORY], + coverage=False, + ), + other=other, + ) + + @staticmethod + @pytest.mark.parametrize( + "flags, attribute, expected", + [ + (["--coverage"], "coverage", True), + ], + ) + def test_overrides_default(flags, attribute, expected): + default = getattr(_unit_test_context(Mock(posargs=[])).known, attribute) + + result = _unit_test_context(Mock(posargs=flags)) + + assert getattr(result.known, attribute) == expected + assert getattr(result.known, attribute) != default - result = _test_command( - path=config.root_path / "dummy", config=config, context=default_context + +class TestIntegrationTestContext: + @staticmethod + @pytest.mark.parametrize("dirs, other", PATH_CASES) + def test_paths_and_other_arguments(dirs, other): + result = _integration_test_context(Mock(posargs=_posargs(dirs, other))) + + assert result == ArgparseResults( + known=Namespace( + paths=[Path(d) for d in dirs] or [INTEGRATION_TESTS_DIRECTORY], + coverage=False, + db_version=PROJECT_CONFIG.minimum_exasol_version, + ), + other=other, ) - assert result == ["pytest", "-v", f"{config.root_path}/dummy"] + @staticmethod + @pytest.mark.parametrize( + "flags, attribute, expected", + [ + (["--coverage"], "coverage", True), + (["--db-version", "8.0.0"], "db_version", "8.0.0"), + ], + ) + def test_overrides_default(flags, attribute, expected): + default = getattr(_integration_test_context(Mock(posargs=[])).known, attribute) + + result = _integration_test_context(Mock(posargs=flags)) + assert getattr(result.known, attribute) == expected + assert getattr(result.known, attribute) != default + + +class TestTestCommand: @staticmethod - def test_works_for_coverage_true(test_project_config_factory, default_context): + def test_without_coverage(test_project_config_factory): config = test_project_config_factory() - default_context["coverage"] = True + argparse_results = ArgparseResults( + known=Namespace(paths=[config.root_path / "dummy"], coverage=False), + other=["-v"], + ) - result = _test_command( - path=config.root_path / "dummy", config=config, context=default_context + result = _test_command(config=config, argparse_results=argparse_results) + + assert result == ["pytest", config.root_path / "dummy", "-v"] + + @staticmethod + def test_with_coverage(test_project_config_factory): + config = test_project_config_factory() + argparse_results = ArgparseResults( + known=Namespace(paths=[config.root_path / "dummy"], coverage=True), + other=["-v"], ) + result = _test_command(config=config, argparse_results=argparse_results) + assert result == [ "coverage", "run", @@ -47,92 +127,36 @@ def test_works_for_coverage_true(test_project_config_factory, default_context): f"--rcfile={config.root_path}/pyproject.toml", "-m", "pytest", + config.root_path / "dummy", "-v", - f"{config.root_path}/dummy", ] - @staticmethod - def test_works_for_fwd_args(test_project_config_factory, default_context): - config = test_project_config_factory() - default_context["fwd-args"] = ["--addition"] - result = _test_command( - path=config.root_path / "dummy", config=config, context=default_context - ) +class RecordingPlugin: + calls: list[str] = [] - assert result == ["pytest", "-v", f"{config.root_path}/dummy", "--addition"] + @hookimpl + def pre_integration_tests_hook(self, session, config, context): + self.calls.append("pre") - -def test_unit_tests(nox_session, test_project_config_factory): - config = test_project_config_factory() - - shutil.copyfile( - PROJECT_CONFIG.root_path / "pyproject.toml", config.root_path / "pyproject.toml" - ) - - test_directory = config.root_path / "test" / "unit" - test_directory.mkdir(parents=True, exist_ok=True) - test_filepath = test_directory / "dummy_test.py" - test_filepath.write_text("def test_dummy():\n assert True") - - with ( - patch("exasol.toolbox.nox._test.PROJECT_CONFIG", new=config), - patch( - "exasol.toolbox.nox._test._unit_test_context", - wraps=lambda session: {"coverage": False, "fwd-args": []}, - ) as unit_context, - ): - unit_tests(nox_session) - - unit_context.assert_called_once_with(nox_session) - assert (test_directory / "__pycache__").exists() + @hookimpl + def post_integration_tests_hook(self, session, config, context): + self.calls.append("post") class TestIntegrationTests: @staticmethod - def test_works_without_hooks(nox_session, test_project_config_factory): - config = test_project_config_factory() - - shutil.copyfile( - PROJECT_CONFIG.root_path / "pyproject.toml", - config.root_path / "pyproject.toml", + def test_hooks_wrap_test_command(test_project_config_factory, monkeypatch): + config = test_project_config_factory( + plugins_for_nox_sessions=(RecordingPlugin,) + ) + argparse_results = ArgparseResults( + known=Namespace(paths=[Path("dummy")], coverage=False), other=[] ) + session = Mock() + session.run.side_effect = lambda *a, **kw: RecordingPlugin.calls.append("run") - test_directory = config.root_path / "test" / "integration" - test_directory.mkdir(parents=True, exist_ok=True) - test_filepath = test_directory / "dummy_test.py" - test_filepath.write_text("def test_dummy():\n assert True") - - with ( - patch("exasol.toolbox.nox._test.PROJECT_CONFIG", new=config), - patch( - "exasol.toolbox.nox._test._integration_test_context", - wraps=lambda session: { - "coverage": False, - "db_version": "8.29.13", - "fwd-args": [], - }, - ) as integration_context, - ): - integration_tests(nox_session) - - integration_context.assert_called_once_with(nox_session) - assert (test_directory / "__pycache__").exists() - - -def test_coverage_uses_integration_test_context(nox_session): - with ( - patch( - "exasol.toolbox.nox._test._integration_test_context", - return_value={"coverage": True, "db_version": "8.29.13", "fwd-args": []}, - ) as integration_context, - patch("exasol.toolbox.nox._test._coverage") as coverage_impl, - ): - coverage(nox_session) - - integration_context.assert_called_once_with(nox_session, coverage=True) - coverage_impl.assert_called_once_with( - nox_session, - PROJECT_CONFIG, - {"coverage": True, "db_version": "8.29.13", "fwd-args": []}, - ) + _integration_tests(session, config, argparse_results) + + session.run.assert_called_once_with("pytest", Path("dummy")) + assert RecordingPlugin.calls == ["pre", "run", "post"]