diff options
| author | orivej <[email protected]> | 2022-02-10 16:45:01 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:01 +0300 | 
| commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
| tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /library/python/pytest | |
| parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/python/pytest')
| -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 79b58cff737..e36f47a78f3 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 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  | 
