diff options
| author | robot-piglet <[email protected]> | 2026-02-06 18:04:04 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2026-02-06 19:43:50 +0300 |
| commit | 758137d5381cc360421c90825bbcff9490f698c4 (patch) | |
| tree | 6f60e6db892a3d59426d3eda6546460c17b4b589 /library/python | |
| parent | 2ddbdb65c0acf216997564126f3f3f4f015d7004 (diff) | |
Intermediate changes
commit_hash:525c32eb93ddaea7b409248280f0871fb5fd788d
Diffstat (limited to 'library/python')
| -rw-r--r-- | library/python/pytest/main.py | 6 | ||||
| -rw-r--r-- | library/python/pytest/plugins/conftests.py | 3 | ||||
| -rw-r--r-- | library/python/pytest/ut/pytest_plugins_env/plugin.py | 6 | ||||
| -rw-r--r-- | library/python/pytest/ut/pytest_plugins_env/test_plugin.py | 2 | ||||
| -rw-r--r-- | library/python/pytest/ut/pytest_plugins_env/ya.make | 21 | ||||
| -rw-r--r-- | library/python/pytest/ut/ya.make | 1 |
6 files changed, 36 insertions, 3 deletions
diff --git a/library/python/pytest/main.py b/library/python/pytest/main.py index c6be6ca802e..b4269247175 100644 --- a/library/python/pytest/main.py +++ b/library/python/pytest/main.py @@ -2,6 +2,10 @@ import os import sys import time +import yatest.common + +import yatest_lib.ya + import __res FORCE_EXIT_TESTSFAILED_ENV = 'FORCE_EXIT_TESTSFAILED' @@ -52,6 +56,8 @@ def main(): m.setattr(_pytest.assertion.truncate, "DEFAULT_MAX_LINES", 16) m.setattr(_pytest.assertion.truncate, "DEFAULT_MAX_CHARS", 32 * 80) + yatest.common.runtime._set_ya_config(ya=yatest_lib.ya.Ya()) + prefix = '__tests__.' test_modules = [ diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py index 7d8c13d93ee..d5c0a4f1947 100644 --- a/library/python/pytest/plugins/conftests.py +++ b/library/python/pytest/plugins/conftests.py @@ -11,7 +11,6 @@ import pytest from library.python.pytest.plugins.fixtures import metrics, links # noqa from library.python.pytest import module_utils import yatest.common -import yatest_lib.ya ConftestInfo = collections.namedtuple('ConftestInfo', ['module_name', 'proper_path']) LoadedConftestInfo = collections.namedtuple('LoadedConftestInfo', ['conftest_dir', 'module']) @@ -81,8 +80,6 @@ _conftest_modules = [] def pytest_load_initial_conftests(early_config): pluginmanager = early_config.pluginmanager - yatest.common.runtime._set_ya_config(ya=yatest_lib.ya.Ya()) - conftests = filter(lambda name: name.endswith('.conftest'), getattr(sys, 'extra_modules', [])) if os.getenv('CONFTEST_LOAD_POLICY') == 'LOCAL': diff --git a/library/python/pytest/ut/pytest_plugins_env/plugin.py b/library/python/pytest/ut/pytest_plugins_env/plugin.py new file mode 100644 index 00000000000..a06541eee8b --- /dev/null +++ b/library/python/pytest/ut/pytest_plugins_env/plugin.py @@ -0,0 +1,6 @@ +import pytest + + +def my_fixture(): + return "value" diff --git a/library/python/pytest/ut/pytest_plugins_env/test_plugin.py b/library/python/pytest/ut/pytest_plugins_env/test_plugin.py new file mode 100644 index 00000000000..dbeb248ad85 --- /dev/null +++ b/library/python/pytest/ut/pytest_plugins_env/test_plugin.py @@ -0,0 +1,2 @@ +def test_my_fixture(my_fixture): + assert my_fixture == "value" diff --git a/library/python/pytest/ut/pytest_plugins_env/ya.make b/library/python/pytest/ut/pytest_plugins_env/ya.make new file mode 100644 index 00000000000..01f313d5bf6 --- /dev/null +++ b/library/python/pytest/ut/pytest_plugins_env/ya.make @@ -0,0 +1,21 @@ +PY23_TEST() + +TEST_SRCS( + test_plugin.py +) + +PY_SRCS( + plugin.py +) + +PEERDIR( + library/python/pytest +) + +ENV( + PYTEST_PLUGINS=library.python.pytest.ut.pytest_plugins_env.plugin +) + +STYLE_PYTHON() + +END() diff --git a/library/python/pytest/ut/ya.make b/library/python/pytest/ut/ya.make index 8a93f4ae690..5cf962dd45a 100644 --- a/library/python/pytest/ut/ya.make +++ b/library/python/pytest/ut/ya.make @@ -15,4 +15,5 @@ END() RECURSE_FOR_TESTS( conftest_local + pytest_plugins_env ) |
