diff options
author | Dmitry Kopylov <kopylovd@gmail.com> | 2022-02-10 16:48:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:18 +0300 |
commit | 7230275728d34873cba1ba78bb68669b0c5faa31 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/python/pytest/plugins/conftests.py | |
parent | b2f5101486cc0de2e979c8ba9ada2109785bf5fd (diff) | |
download | ydb-7230275728d34873cba1ba78bb68669b0c5faa31.tar.gz |
Restoring authorship annotation for Dmitry Kopylov <kopylovd@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/python/pytest/plugins/conftests.py')
-rw-r--r-- | library/python/pytest/plugins/conftests.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py index dfae771ef8..522041f5a7 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 |