tests/functional2: do not copy testlib tests to internal environment

When testing specific internal functionallity while needing things from
the testlib, so far, the tests for the testlib have always been copied
too.
To reduce the amount of additional program required when later making
the env of the pytest_command declarative, and to not test the same
tests a multitude of times (and potentially reaching infinite recursion)
those tests will no longer be copied

Change-Id: I36ec3824a21ed30f9b8ff19948031d1edbf6c76c
This commit is contained in:
Commentator2.0
2025-08-07 14:25:51 +02:00
committed by Commentator2.0
parent a9117791e2
commit 8bbd5e1d0d
2 changed files with 14 additions and 4 deletions
+8 -2
View File
@@ -55,16 +55,22 @@ def get_functional2_files(additional_files: FileDeclaration | None = None) -> Fi
def get_functional2_files_with_testlib(
additional_files: FileDeclaration | None = None,
additional_files: FileDeclaration | None = None, no_tests: bool = True
) -> FileDeclaration:
if additional_files is None:
additional_files = {}
if no_tests:
def ignore(_: Any, names: list[str]) -> list[str]:
return [name for name in names if name.startswith("test_")]
else:
ignore = None
return get_functional2_files(
merge_file_declaration(
{
"functional2": {
"conftest.py": CopyFile(functional2_base_folder / "conftest.py"),
"testlib": CopyTree(functional2_base_folder / "testlib"),
"testlib": CopyTree(functional2_base_folder / "testlib", ignore=ignore),
}
},
additional_files,