summaryrefslogtreecommitdiffstats
path: root/library/python/pytest/plugins/conftests.py
diff options
context:
space:
mode:
authororivej <[email protected]>2022-02-10 16:45:01 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:01 +0300
commit2d37894b1b037cf24231090eda8589bbb44fb6fc (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /library/python/pytest/plugins/conftests.py
parent718c552901d703c502ccbefdfc3c9028d608b947 (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 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 17cf1197e57..522041f5a7c 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