aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/pytest
diff options
context:
space:
mode:
authorexprmntr <exprmntr@yandex-team.ru>2022-02-10 16:46:50 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:50 +0300
commit078ddb2fb76387cae14e8c3ceb5a896009a5a539 (patch)
treedda2d61bf8f818c76b5602b79366b5fcbcf2e479 /library/python/pytest
parent5085152b94bf621933243a498def7f37d2e76b58 (diff)
downloadydb-078ddb2fb76387cae14e8c3ceb5a896009a5a539.tar.gz
Restoring authorship annotation for exprmntr <exprmntr@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/pytest')
-rw-r--r--library/python/pytest/allure/ya.make10
-rw-r--r--library/python/pytest/main.py10
-rw-r--r--library/python/pytest/plugins/collection.py4
-rw-r--r--library/python/pytest/plugins/conftests.py2
-rw-r--r--library/python/pytest/plugins/ya.make2
-rw-r--r--library/python/pytest/plugins/ya.py36
-rw-r--r--library/python/pytest/ya.make2
-rw-r--r--library/python/pytest/yatest_tools.py2
8 files changed, 34 insertions, 34 deletions
diff --git a/library/python/pytest/allure/ya.make b/library/python/pytest/allure/ya.make
index ab3f449c7f..bbde4934e3 100644
--- a/library/python/pytest/allure/ya.make
+++ b/library/python/pytest/allure/ya.make
@@ -1,11 +1,11 @@
PY23_LIBRARY()
-OWNER(exprmntr)
-
+OWNER(exprmntr)
+
PY_SRCS(conftest.py)
PEERDIR(
contrib/python/pytest-allure-adaptor
-)
-
-END()
+)
+
+END()
diff --git a/library/python/pytest/main.py b/library/python/pytest/main.py
index 6296bd6f0f..7f9e4bf05e 100644
--- a/library/python/pytest/main.py
+++ b/library/python/pytest/main.py
@@ -25,11 +25,11 @@ def main():
if FORCE_EXIT_TESTSFAILED_ENV in os.environ:
del os.environ[FORCE_EXIT_TESTSFAILED_ENV]
- if "Y_PYTHON_CLEAR_ENTRY_POINT" in os.environ:
- if "Y_PYTHON_ENTRY_POINT" in os.environ:
- del os.environ["Y_PYTHON_ENTRY_POINT"]
- del os.environ["Y_PYTHON_CLEAR_ENTRY_POINT"]
-
+ if "Y_PYTHON_CLEAR_ENTRY_POINT" in os.environ:
+ if "Y_PYTHON_ENTRY_POINT" in os.environ:
+ del os.environ["Y_PYTHON_ENTRY_POINT"]
+ del os.environ["Y_PYTHON_CLEAR_ENTRY_POINT"]
+
listing_mode = '--collect-only' in sys.argv
yatest_runner = os.environ.get('YA_TEST_RUNNER') == '1'
diff --git a/library/python/pytest/plugins/collection.py b/library/python/pytest/plugins/collection.py
index e36f47a78f..626a90d830 100644
--- a/library/python/pytest/plugins/collection.py
+++ b/library/python/pytest/plugins/collection.py
@@ -3,8 +3,8 @@ import sys
from six import reraise
import py
-
-import pytest # noqa
+
+import pytest # noqa
import _pytest.python
import _pytest.doctest
import json
diff --git a/library/python/pytest/plugins/conftests.py b/library/python/pytest/plugins/conftests.py
index 522041f5a7..57b5068778 100644
--- a/library/python/pytest/plugins/conftests.py
+++ b/library/python/pytest/plugins/conftests.py
@@ -5,7 +5,7 @@ import inspect
from pytest import hookimpl
-from .fixtures import metrics, links # noqa
+from .fixtures import metrics, links # noqa
orig_getfile = inspect.getfile
diff --git a/library/python/pytest/plugins/ya.make b/library/python/pytest/plugins/ya.make
index c15d6f759d..845233a945 100644
--- a/library/python/pytest/plugins/ya.make
+++ b/library/python/pytest/plugins/ya.make
@@ -1,6 +1,6 @@
OWNER(g:yatest)
-PY23_LIBRARY()
+PY23_LIBRARY()
PY_SRCS(
ya.py
diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py
index 1bde03042d..e5be206542 100644
--- a/library/python/pytest/plugins/ya.py
+++ b/library/python/pytest/plugins/ya.py
@@ -52,8 +52,8 @@ import yatest_lib.tools
import yatest_lib.external as canon
-import yatest_lib.ya
-
+import yatest_lib.ya
+
from library.python.pytest import context
console_logger = logging.getLogger("console")
@@ -150,7 +150,7 @@ def pytest_addoption(parser):
parser.addoption("--test-file-filter", action="store", dest="test_file_filter", default=None, help="test file filter")
parser.addoption("--test-param", action="append", dest="test_params", default=None, help="test parameters")
parser.addoption("--test-log-level", action="store", dest="test_log_level", choices=["critical", "error", "warning", "info", "debug"], default="debug", help="test log level")
- parser.addoption("--mode", action="store", choices=[yatest_lib.ya.RunMode.List, yatest_lib.ya.RunMode.Run], dest="mode", default=yatest_lib.ya.RunMode.Run, help="testing mode")
+ parser.addoption("--mode", action="store", choices=[yatest_lib.ya.RunMode.List, yatest_lib.ya.RunMode.Run], dest="mode", default=yatest_lib.ya.RunMode.Run, help="testing mode")
parser.addoption("--test-list-file", action="store", dest="test_list_file")
parser.addoption("--modulo", default=1, type=int)
parser.addoption("--modulo-index", default=0, type=int)
@@ -159,9 +159,9 @@ def pytest_addoption(parser):
parser.addoption("--project-path", action="store", default="", help="path to CMakeList where test is declared")
parser.addoption("--build-type", action="store", default="", help="build type")
parser.addoption("--flags", action="append", dest="flags", default=[], help="build flags (-D)")
- parser.addoption("--sanitize", action="store", default="", help="sanitize mode")
+ parser.addoption("--sanitize", action="store", default="", help="sanitize mode")
parser.addoption("--test-stderr", action="store_true", default=False, help="test stderr")
- parser.addoption("--test-debug", action="store_true", default=False, help="test debug mode")
+ parser.addoption("--test-debug", action="store_true", default=False, help="test debug mode")
parser.addoption("--root-dir", action="store", default=None)
parser.addoption("--ya-trace", action="store", dest="ya_trace_path", default=None, help="path to ya trace report")
parser.addoption("--ya-version", action="store", dest="ya_version", default=0, type=int, help="allows to be compatible with ya and the new changes in ya-dev")
@@ -197,17 +197,17 @@ def pytest_configure(config):
context = {
"project_path": config.option.project_path,
"test_stderr": config.option.test_stderr,
- "test_debug": config.option.test_debug,
+ "test_debug": config.option.test_debug,
"build_type": config.option.build_type,
"test_traceback": config.option.tbstyle,
- "flags": config.option.flags,
- "sanitize": config.option.sanitize,
+ "flags": config.option.flags,
+ "sanitize": config.option.sanitize,
}
-
- if config.option.collectonly:
- config.option.mode = yatest_lib.ya.RunMode.List
-
- config.ya = yatest_lib.ya.Ya(
+
+ if config.option.collectonly:
+ config.option.mode = yatest_lib.ya.RunMode.List
+
+ config.ya = yatest_lib.ya.Ya(
config.option.mode,
config.option.source_root,
config.option.build_root,
@@ -491,13 +491,13 @@ def pytest_collection_modifyitems(items, config):
items.extend(item)
yatest_logger.info("Modulo %s tests are: %s", modulo_index, chunk_items)
- if config.option.mode == yatest_lib.ya.RunMode.Run:
+ if config.option.mode == yatest_lib.ya.RunMode.Run:
for item in items:
test_item = NotLaunchedTestItem(item.nodeid, config.option.test_suffix)
config.ya_trace_reporter.on_start_test_class(test_item)
config.ya_trace_reporter.on_finish_test_case(test_item)
config.ya_trace_reporter.on_finish_test_class(test_item)
- elif config.option.mode == yatest_lib.ya.RunMode.List:
+ elif config.option.mode == yatest_lib.ya.RunMode.List:
tests = []
for item in items:
item = CustomTestItem(item.nodeid, pytest_config.option.test_suffix, item.keywords)
@@ -695,7 +695,7 @@ class TestItem(object):
if isinstance(entry, _pytest.reports.BaseReport):
self._error = get_formatted_error(entry)
else:
- self._error = "[[{}]]{}".format(yatest_lib.tools.to_str(marker), yatest_lib.tools.to_str(entry))
+ self._error = "[[{}]]{}".format(yatest_lib.tools.to_str(marker), yatest_lib.tools.to_str(entry))
@property
def duration(self):
@@ -811,7 +811,7 @@ class TraceReportGenerator(object):
def on_finish_test_class(self, test_item):
pytest_config.ya.set_test_item_node_id(test_item.nodeid)
- self.trace('test-finished', {'class': test_item.class_name.decode('utf-8') if sys.version_info[0] < 3 else test_item.class_name})
+ self.trace('test-finished', {'class': test_item.class_name.decode('utf-8') if sys.version_info[0] < 3 else test_item.class_name})
def on_start_test_case(self, test_item):
class_name = yatest_lib.tools.to_utf8(test_item.class_name)
@@ -888,7 +888,7 @@ class TraceReportGenerator(object):
'name': name
}
- data = yatest_lib.tools.to_str(json.dumps(event, ensure_ascii=False))
+ data = yatest_lib.tools.to_str(json.dumps(event, ensure_ascii=False))
self._file.write(data + '\n')
self._file.flush()
diff --git a/library/python/pytest/ya.make b/library/python/pytest/ya.make
index 060c92c313..e68402e7c1 100644
--- a/library/python/pytest/ya.make
+++ b/library/python/pytest/ya.make
@@ -1,4 +1,4 @@
-PY23_LIBRARY()
+PY23_LIBRARY()
OWNER(
g:yatool
diff --git a/library/python/pytest/yatest_tools.py b/library/python/pytest/yatest_tools.py
index 6b8b896394..f7b084193d 100644
--- a/library/python/pytest/yatest_tools.py
+++ b/library/python/pytest/yatest_tools.py
@@ -257,7 +257,7 @@ def normalize_filename(filename):
:param some_string: string to be converted to a valid file name
:return: valid file name
"""
- not_allowed_pattern = r"[\[\]\/:*?\"\'<>|+\0\\\s\x0b\x0c]"
+ not_allowed_pattern = r"[\[\]\/:*?\"\'<>|+\0\\\s\x0b\x0c]"
filename = re.sub(not_allowed_pattern, ".", filename)
return re.sub(r"\.{2,}", ".", filename)