diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-05-05 12:31:52 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-05-05 12:41:33 +0300 |
commit | 6ff49ec58061f642c3a2f83c61eba12820787dfc (patch) | |
tree | c733ec9bdb15ed280080d31dea8725bfec717acd /library/python/pytest | |
parent | eefca8305c6a545cc6b16dca3eb0d91dcef2adcd (diff) | |
download | ydb-6ff49ec58061f642c3a2f83c61eba12820787dfc.tar.gz |
Intermediate changes
commit_hash:8b3bb826b17db8329ed1221f545c0645f12c552d
Diffstat (limited to 'library/python/pytest')
-rw-r--r-- | library/python/pytest/plugins/collection.py | 10 | ||||
-rw-r--r-- | library/python/pytest/plugins/conftests.py | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/library/python/pytest/plugins/collection.py b/library/python/pytest/plugins/collection.py index 8bc375c625d..e9940d8dacb 100644 --- a/library/python/pytest/plugins/collection.py +++ b/library/python/pytest/plugins/collection.py @@ -11,6 +11,9 @@ import _pytest.doctest import json import library.python.testing.filter.filter as test_filter +if sys.version_info > (3,): + import _pytest.stash + class LoadedModule(_pytest.python.Module): def __init__(self, parent, name, **kwargs): @@ -22,6 +25,8 @@ class LoadedModule(_pytest.python.Module): self.own_markers = [] self.extra_keyword_matches = set() self.fspath = py.path.local() + if sys.version_info > (3,): + self.stash = _pytest.stash.Stash() @classmethod def from_parent(cls, **kwargs): @@ -67,7 +72,10 @@ class DoctestModule(LoadedModule): module = self._getobj() # uses internal doctest module parsing mechanism finder = doctest.DocTestFinder() - optionflags = _pytest.doctest.get_optionflags(self) + if sys.version_info > (3,): + optionflags = _pytest.doctest.get_optionflags(self.config) + else: + optionflags = _pytest.doctest.get_optionflags(self) runner = doctest.DebugRunner(verbose=0, optionflags=optionflags) try: diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py index 3224d2c84f5..4af60b1a049 100644 --- a/library/python/pytest/plugins/conftests.py +++ b/library/python/pytest/plugins/conftests.py @@ -46,7 +46,10 @@ def pytest_load_initial_conftests(early_config, parser, args): mod.__orig_file__ = mod.__file__ mod.__file__ = "" conftest_modules.append(mod) - early_config.pluginmanager.consider_conftest(mod) + if sys.version_info > (3,): + early_config.pluginmanager.consider_conftest(mod, registration_name=mod.__file__) + else: + early_config.pluginmanager.consider_conftest(mod) def getconftestmodules(*args, **kwargs): |