aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/pytest/plugins/conftests.py
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /library/python/pytest/plugins/conftests.py
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
downloadydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/pytest/plugins/conftests.py')
-rw-r--r--library/python/pytest/plugins/conftests.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py
index 522041f5a7c..17cf1197e57 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