diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/python/pytest/main.py | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/pytest/main.py')
-rw-r--r-- | library/python/pytest/main.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/library/python/pytest/main.py b/library/python/pytest/main.py index 6296bd6f0f..a3bb791f1c 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: |