diff options
| author | antonyzhilin <[email protected]> | 2026-03-18 20:01:00 +0300 |
|---|---|---|
| committer | antonyzhilin <[email protected]> | 2026-03-18 20:39:57 +0300 |
| commit | e156035788bddca3eb74b11bddc9afc4256d1f7b (patch) | |
| tree | 864514f5bfa3dc41c754f7ad4ce15d903020084e /library/python/pytest/plugins/conftests.py | |
| parent | b58f49094ff1acc06d494406856270d6c3b61761 (diff) | |
feat pytest: clean up CONFTEST_LOAD_POLICY_LOCAL implementation
* Add docs for `CONFTEST_LOAD_POLICY_LOCAL` and `CONFTEST_LOAD_POLICY_LEGACY_GLOBAL`
* Use `ya_` prefixes for custom fields of `LoadedModule` to differentiate from fields used by pytest
* Clean up `LoadedModule.__init__` parameters
* Move resfs modules lookup from `main.py` to `collection.py` to gather module name lookup and loading in the same place
* Turn `collection.py` into a plugin instead of using a class plugin. As a benefit, it is now displayed as `library.python.pytest.plugins.collection` in the plugin list (previously it was displayed as `<unnamed plugin>`)
commit_hash:be61134f075fbc9b645cc98635ab33fe7bf8a979
Diffstat (limited to 'library/python/pytest/plugins/conftests.py')
| -rw-r--r-- | library/python/pytest/plugins/conftests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py index 667874bb3d8..aa2915fcd59 100644 --- a/library/python/pytest/plugins/conftests.py +++ b/library/python/pytest/plugins/conftests.py @@ -99,6 +99,10 @@ def pytest_load_initial_conftests(early_config): extra_modules = getattr(sys, 'extra_modules', []) conftests = filter(lambda name: name == 'conftest' or name.endswith('.conftest'), extra_modules) + # CONFTEST_LOAD_POLICY is set by ya.make macros: + # * CONFTEST_LOAD_POLICY_LOCAL() + # * CONFTEST_LOAD_POLICY_LEGACY_GLOBAL() + # Current default is LEGACY_GLOBAL. if os.getenv('CONFTEST_LOAD_POLICY') == 'LOCAL': test_dir = str(yatest.common.context.project_path) |
