From fbe66244b8b9e2aabe14a524565664eeca42dc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Mon, 19 Apr 2021 22:39:08 +0200 Subject: [PATCH] Fix some typos, remove redundant words and escapes (#8564) * doc: Fix typos, remove double words * Remove redundant escapes in regex --- doc/en/changelog.rst | 4 ++-- scripts/release-on-comment.py | 2 +- src/_pytest/capture.py | 2 +- src/_pytest/doctest.py | 2 +- src/_pytest/store.py | 2 +- testing/logging/test_reporting.py | 18 +++++++++--------- testing/python/metafunc.py | 5 ++--- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index b07996ae2..0ff7ede3d 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -5097,7 +5097,7 @@ Improved Documentation - In one of the simple examples, use ``pytest_collection_modifyitems()`` to skip tests based on a command-line option, allowing its sharing while preventing a - user error when acessing ``pytest.config`` before the argument parsing. + user error when accessing ``pytest.config`` before the argument parsing. (`#2653 `_) @@ -5509,7 +5509,7 @@ Changes Thanks `@ojii`_ for the PR. * Replace minor/patch level version numbers in the documentation with placeholders. - This significantly reduces change-noise as different contributors regnerate + This significantly reduces change-noise as different contributors regenerate the documentation on different platforms. Thanks `@RonnyPfannschmidt`_ for the PR. diff --git a/scripts/release-on-comment.py b/scripts/release-on-comment.py index 3f4c1ed57..f33def3ef 100644 --- a/scripts/release-on-comment.py +++ b/scripts/release-on-comment.py @@ -82,7 +82,7 @@ def validate_and_get_issue_comment_payload( ) -> Tuple[str, str, bool]: payload = json.loads(issue_payload_path.read_text(encoding="UTF-8")) body = get_comment_data(payload)["body"] - m = re.match(r"@pytestbot please prepare (major )?release from ([\w\-_\.]+)", body) + m = re.match(r"@pytestbot please prepare (major )?release from ([-_.\w]+)", body) if m: is_major, base_branch = m.group(1) is not None, m.group(2) else: diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 355f42591..9e2d3fa62 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -363,7 +363,7 @@ class FDCaptureBinary: except OSError: # FD capturing is conceptually simple -- create a temporary file, # redirect the FD to it, redirect back when done. But when the - # target FD is invalid it throws a wrench into this loveley scheme. + # target FD is invalid it throws a wrench into this lovely scheme. # # Tests themselves shouldn't care if the FD is valid, FD capturing # should work regardless of external circumstances. So falling back diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 9b877cfd9..3547c422e 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -268,7 +268,7 @@ class DoctestItem(pytest.Item): runner: "doctest.DocTestRunner", dtest: "doctest.DocTest", ): - # incompatible signature due to to imposed limits on sublcass + # incompatible signature due to imposed limits on subclass """The public named constructor.""" return super().from_parent(name=name, parent=parent, runner=runner, dtest=dtest) diff --git a/src/_pytest/store.py b/src/_pytest/store.py index e5008cfc5..43fd9e89e 100644 --- a/src/_pytest/store.py +++ b/src/_pytest/store.py @@ -25,7 +25,7 @@ class StoreKey(Generic[T]): class Store: - """Store is a type-safe heterogenous mutable mapping that + """Store is a type-safe heterogeneous mutable mapping that allows keys and value types to be defined separately from where it (the Store) is created. diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index a5ab8b98b..323ff7b24 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -235,7 +235,7 @@ def test_log_cli_default_level(pytester: Pytester) -> None: ] ) result.stdout.no_fnmatch_line("*INFO message won't be shown*") - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 @@ -528,7 +528,7 @@ def test_log_cli_level(pytester: Pytester) -> None: ) result.stdout.no_fnmatch_line("*This log message won't be shown*") - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 result = pytester.runpytest("-s", "--log-level=INFO") @@ -542,7 +542,7 @@ def test_log_cli_level(pytester: Pytester) -> None: ) result.stdout.no_fnmatch_line("*This log message won't be shown*") - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 @@ -578,7 +578,7 @@ def test_log_cli_ini_level(pytester: Pytester) -> None: ) result.stdout.no_fnmatch_line("*This log message won't be shown*") - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 @@ -653,7 +653,7 @@ def test_log_file_cli(pytester: Pytester) -> None: # fnmatch_lines does an assertion internally result.stdout.fnmatch_lines(["test_log_file_cli.py PASSED"]) - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 assert os.path.isfile(log_file) with open(log_file) as rfh: @@ -684,7 +684,7 @@ def test_log_file_cli_level(pytester: Pytester) -> None: # fnmatch_lines does an assertion internally result.stdout.fnmatch_lines(["test_log_file_cli_level.py PASSED"]) - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 assert os.path.isfile(log_file) with open(log_file) as rfh: @@ -735,7 +735,7 @@ def test_log_file_ini(pytester: Pytester) -> None: # fnmatch_lines does an assertion internally result.stdout.fnmatch_lines(["test_log_file_ini.py PASSED"]) - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 assert os.path.isfile(log_file) with open(log_file) as rfh: @@ -774,7 +774,7 @@ def test_log_file_ini_level(pytester: Pytester) -> None: # fnmatch_lines does an assertion internally result.stdout.fnmatch_lines(["test_log_file_ini_level.py PASSED"]) - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 assert os.path.isfile(log_file) with open(log_file) as rfh: @@ -808,7 +808,7 @@ def test_log_file_unicode(pytester: Pytester) -> None: result = pytester.runpytest() - # make sure that that we get a '0' exit code for the testsuite + # make sure that we get a '0' exit code for the testsuite assert result.ret == 0 assert os.path.isfile(log_file) with open(log_file, encoding="utf-8") as rfh: diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 6577ff18e..4a4b141c4 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -692,9 +692,8 @@ class TestMetafunc: """ #714 Test parametrization with 'indirect' parameter applied on - particular arguments. As y is is direct, its value should - be used directly rather than being passed to the fixture - y. + particular arguments. As y is direct, its value should + be used directly rather than being passed to the fixture y. :param pytester: the instance of Pytester class, a temporary test directory.