diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /library/python/pytest/plugins | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/pytest/plugins')
-rw-r--r-- | library/python/pytest/plugins/collection.py | 2 | ||||
-rw-r--r-- | library/python/pytest/plugins/conftests.py | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/library/python/pytest/plugins/collection.py b/library/python/pytest/plugins/collection.py index e36f47a78f..79b58cff73 100644 --- a/library/python/pytest/plugins/collection.py +++ b/library/python/pytest/plugins/collection.py @@ -69,7 +69,7 @@ class DoctestModule(LoadedModule): parent=self, runner=runner, dtest=test) - except Exception: + except Exception: import logging logging.exception('DoctestModule failed, probably you can add NO_DOCTESTS() macro to ya.make') etype, exc, tb = sys.exc_info() diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py index 522041f5a7..17cf1197e5 100644 --- a/library/python/pytest/plugins/conftests.py +++ b/library/python/pytest/plugins/conftests.py @@ -1,6 +1,6 @@ import os import importlib -import sys +import sys import inspect from pytest import hookimpl @@ -18,19 +18,19 @@ def getfile(object): return res inspect.getfile = getfile -conftest_modules = [] +conftest_modules = [] @hookimpl(trylast=True) def pytest_load_initial_conftests(early_config, parser, args): conftests = filter(lambda name: name.endswith(".conftest"), sys.extra_modules) - + def conftest_key(name): if not name.startswith("__tests__."): # Make __tests__ come last return "_." + name return name - + for name in sorted(conftests, key=conftest_key): mod = importlib.import_module(name) if os.getenv("CONFTEST_LOAD_POLICY") != "LOCAL": @@ -40,11 +40,11 @@ def pytest_load_initial_conftests(early_config, parser, args): early_config.pluginmanager.consider_conftest(mod) -def getconftestmodules(*args, **kwargs): - return conftest_modules - - -def pytest_sessionstart(session): +def getconftestmodules(*args, **kwargs): + return conftest_modules + + +def pytest_sessionstart(session): # Override filesystem based relevant conftest discovery on the call path assert session.config.pluginmanager session.config.pluginmanager._getconftestmodules = getconftestmodules |