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 | |
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')
-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 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: diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py index 1bde03042d..843ab97414 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 70d6c98516..01b4e0e535 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 |