diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 09:01:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 09:01:56 +0000 |
commit | 89c4287dc1d423987b3ed83c28335bb3dcb0f06e (patch) | |
tree | b2406a87652796c5a1622815061870d1c45322d5 /tests/conftest.py | |
parent | Adding upstream version 0.15.0. (diff) | |
download | anta-upstream.tar.xz anta-upstream.zip |
Adding upstream version 1.0.0.upstream/1.0.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index d6b1b8c..e315338 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -44,7 +44,10 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None: It will parametrize test cases based on the `DATA` data structure defined in `tests.units.anta_tests` modules. See `tests/units/anta_tests/README.md` for more information on how to use it. Test IDs are generated using the `build_test_id` function above. + + Checking that only the function "test" is parametrized with data to allow for writing tests for helper functions + in each module. """ - if "tests.units.anta_tests" in metafunc.module.__package__: + if "tests.units.anta_tests" in metafunc.module.__package__ and metafunc.function.__name__ == "test": # This is a unit test for an AntaTest subclass metafunc.parametrize("data", metafunc.module.DATA, ids=build_test_id) |