aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/pytest/plugins/conftests.py
diff options
context:
space:
mode:
authorDmitry Kopylov <kopylovd@gmail.com>2022-02-10 16:48:18 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:18 +0300
commitb2f5101486cc0de2e979c8ba9ada2109785bf5fd (patch)
treeaffe28b840816b505db0467f2285b01c89c04247 /library/python/pytest/plugins/conftests.py
parente9b28b5aad71453a4637b70dde02e801e4147a2a (diff)
downloadydb-b2f5101486cc0de2e979c8ba9ada2109785bf5fd.tar.gz
Restoring authorship annotation for Dmitry Kopylov <kopylovd@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/python/pytest/plugins/conftests.py')
-rw-r--r--library/python/pytest/plugins/conftests.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py
index 522041f5a7..dfae771ef8 100644
--- a/library/python/pytest/plugins/conftests.py
+++ b/library/python/pytest/plugins/conftests.py
@@ -1,26 +1,26 @@
import os
-import importlib
+import importlib
import sys
-import inspect
+import inspect
from pytest import hookimpl
from .fixtures import metrics, links # noqa
-
-orig_getfile = inspect.getfile
-
-
-def getfile(object):
- res = orig_getfile(object)
- if inspect.ismodule(object):
- if not res and getattr(object, '__orig_file__'):
- res = object.__orig_file__
- return res
-
-inspect.getfile = getfile
+
+orig_getfile = inspect.getfile
+
+
+def getfile(object):
+ res = orig_getfile(object)
+ if inspect.ismodule(object):
+ if not res and getattr(object, '__orig_file__'):
+ res = object.__orig_file__
+ return res
+
+inspect.getfile = getfile
conftest_modules = []
-
-
+
+
@hookimpl(trylast=True)
def pytest_load_initial_conftests(early_config, parser, args):
conftests = filter(lambda name: name.endswith(".conftest"), sys.extra_modules)
@@ -45,6 +45,6 @@ def getconftestmodules(*args, **kwargs):
def pytest_sessionstart(session):
- # Override filesystem based relevant conftest discovery on the call path
- assert session.config.pluginmanager
- session.config.pluginmanager._getconftestmodules = getconftestmodules
+ # Override filesystem based relevant conftest discovery on the call path
+ assert session.config.pluginmanager
+ session.config.pluginmanager._getconftestmodules = getconftestmodules