diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/python/pytest | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/pytest')
-rw-r--r-- | library/python/pytest/main.py | 40 | ||||
-rw-r--r-- | library/python/pytest/plugins/ya.py | 2 | ||||
-rw-r--r-- | library/python/pytest/pytest.yatest.ini | 4 |
3 files changed, 23 insertions, 23 deletions
diff --git a/library/python/pytest/main.py b/library/python/pytest/main.py index a3bb791f1c..6296bd6f0f 100644 --- a/library/python/pytest/main.py +++ b/library/python/pytest/main.py @@ -45,12 +45,12 @@ def main(): m = MonkeyPatch() m.setattr(_pytest.assertion.rewrite, "AssertionRewritingHook", rewrite.AssertionRewritingHook) - prefix = '__tests__.' + prefix = '__tests__.' - test_modules = [ - name[len(prefix):] for name in sys.extra_modules - if name.startswith(prefix) and not name.endswith('.conftest') - ] + test_modules = [ + name[len(prefix):] for name in sys.extra_modules + if name.startswith(prefix) and not name.endswith('.conftest') + ] doctest_packages = __res.find("PY_DOCTEST_PACKAGES") or "" if isinstance(doctest_packages, bytes): @@ -68,27 +68,27 @@ def main(): if is_doctest_module(name) ] - def remove_user_site(paths): - site_paths = ('site-packages', 'site-python') + def remove_user_site(paths): + site_paths = ('site-packages', 'site-python') - def is_site_path(path): - for p in site_paths: - if path.find(p) != -1: - return True - return False + def is_site_path(path): + for p in site_paths: + if path.find(p) != -1: + return True + return False - new_paths = list(paths) - for p in paths: - if is_site_path(p): - new_paths.remove(p) + new_paths = list(paths) + for p in paths: + if is_site_path(p): + new_paths.remove(p) - return new_paths + return new_paths - sys.path = remove_user_site(sys.path) + sys.path = remove_user_site(sys.path) rc = pytest.main(plugins=[ collection.CollectionPlugin(test_modules, doctest_modules), - ya, - conftests, + ya, + conftests, ]) if rc == 5: diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py index 843ab97414..1bde03042d 100644 --- a/library/python/pytest/plugins/ya.py +++ b/library/python/pytest/plugins/ya.py @@ -246,7 +246,7 @@ def pytest_configure(config): os.environ.pop(envvar) if envvar + '_ORIGINAL' in os.environ: os.environ[envvar] = os.environ[envvar + '_ORIGINAL'] - + if config.option.root_dir: config.rootdir = py.path.local(config.option.root_dir) config.invocation_params = attr.evolve(config.invocation_params, dir=config.rootdir) diff --git a/library/python/pytest/pytest.yatest.ini b/library/python/pytest/pytest.yatest.ini index 01b4e0e535..70d6c98516 100644 --- a/library/python/pytest/pytest.yatest.ini +++ b/library/python/pytest/pytest.yatest.ini @@ -1,6 +1,6 @@ [pytest] -pep8maxlinelength = 200 -norecursedirs = * +pep8maxlinelength = 200 +norecursedirs = * pep8ignore = E127 E123 E226 E24 filterwarnings = ignore::pytest.RemovedInPytest4Warning |