diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ac7fcc3d..83f7b697b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.16.0 + rev: v2.18.2 hooks: - id: pyupgrade args: [--py36-plus] diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 7f18f62cb..c32ccb6ea 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1611,7 +1611,7 @@ def parse_warning_filter( raise warnings._OptionError(f"too many fields (max 5): {arg!r}") while len(parts) < 5: parts.append("") - action_, message, category_, module, lineno_ = [s.strip() for s in parts] + action_, message, category_, module, lineno_ = (s.strip() for s in parts) action: str = warnings._getaction(action_) # type: ignore[attr-defined] category: Type[Warning] = warnings._getcategory(category_) # type: ignore[attr-defined] if message and escape: diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 139e2a9a7..5cb062932 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1388,7 +1388,7 @@ def test_runs_twice(pytester: Pytester, run_and_parse: RunAndParse) -> None: result, dom = run_and_parse(f, f) result.stdout.no_fnmatch_line("*INTERNALERROR*") - first, second = [x["classname"] for x in dom.find_by_tag("testcase")] + first, second = (x["classname"] for x in dom.find_by_tag("testcase")) assert first == second @@ -1406,7 +1406,7 @@ def test_runs_twice_xdist( result, dom = run_and_parse(f, "--dist", "each", "--tx", "2*popen") result.stdout.no_fnmatch_line("*INTERNALERROR*") - first, second = [x["classname"] for x in dom.find_by_tag("testcase")] + first, second = (x["classname"] for x in dom.find_by_tag("testcase")) assert first == second