diff --git a/extra/get_issues.py b/extra/get_issues.py index a0c2f19ad..64e859e0c 100644 --- a/extra/get_issues.py +++ b/extra/get_issues.py @@ -1,5 +1,6 @@ import json from pathlib import Path +import sys import requests @@ -17,7 +18,7 @@ def get_issues(): if r.status_code == 403: # API request limit exceeded print(data["message"]) - exit(1) + sys.exit(1) issues.extend(data) # Look for next page diff --git a/pyproject.toml b/pyproject.toml index 11590a90e..0627c94c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -190,7 +190,6 @@ disable = [ "consider-using-from-import", "consider-using-f-string", "consider-using-in", - "consider-using-sys-exit", "consider-using-ternary", "consider-using-with", "cyclic-import", @@ -201,7 +200,6 @@ disable = [ "expression-not-assigned", "fixme", "global-statement", - "implicit-str-concat", "import-error", "import-outside-toplevel", "inconsistent-return-statements", @@ -212,10 +210,9 @@ disable = [ "keyword-arg-before-vararg", "line-too-long", "method-hidden", - "misplaced-bare-raise", "missing-docstring", "missing-timeout", - "multiple-statements", + "multiple-statements", # multiple-statements-on-one-line-colon (E701) from ruff "no-else-break", "no-else-continue", "no-else-raise", diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index bcb05ac34..c7ab1182f 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -161,15 +161,13 @@ class Visitor: ) if not self.breadthfirst: for subdir in dirs: - for p in self.gen(subdir): - yield p + yield from self.gen(subdir) for p in self.optsort(entries): if self.fil is None or self.fil(p): yield p if self.breadthfirst: for subdir in dirs: - for p in self.gen(subdir): - yield p + yield from self.gen(subdir) class FNMatcher: diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index af5e443ce..c9139d369 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -401,7 +401,7 @@ class LogCaptureHandler(logging_StreamHandler): # The default behavior of logging is to print "Logging error" # to stderr with the call stack and some extra details. # pytest wants to make such mistakes visible during testing. - raise + raise # pylint: disable=misplaced-bare-raise @final diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index ea5794b25..0215aba96 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -207,7 +207,7 @@ class CommonFSTests: @pytest.mark.parametrize( "fil", - ["*dir", "*dir", pytest.mark.skip("sys.version_info <" " (3,6)")(b"*dir")], + ["*dir", "*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")], ) def test_visit_filterfunc_is_string(self, path1, fil): lst = [] diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index 8728ae84f..08158f619 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -1163,7 +1163,7 @@ class TestNewFirst: ) p1.write_text( - "def test_1(): assert 1\n" "def test_2(): assert 1\n", encoding="utf-8" + "def test_1(): assert 1\ndef test_2(): assert 1\n", encoding="utf-8" ) os.utime(p1, ns=(p1.stat().st_atime_ns, int(1e9)))