aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/pytest/main.py
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/python/pytest/main.py
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/pytest/main.py')
-rw-r--r--library/python/pytest/main.py40
1 files changed, 20 insertions, 20 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: