Skip to content

Commit

Permalink
Apply ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 19, 2024
1 parent bd5dd43 commit cad5def
Showing 1 changed file with 50 additions and 34 deletions.
84 changes: 50 additions & 34 deletions tests/test_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ def test_default_flake8_ignores(self, testdir):
testdir.tmpdir.ensure("tests/hello.py")
result = testdir.runpytest("--flake8", "-s")
result.assert_outcomes(passed=2)
result.stdout.fnmatch_lines([
"*collected 2*",
"*xy.py .*",
"*2 passed*",
])
result.stdout.fnmatch_lines(
[
"*collected 2*",
"*xy.py .*",
"*2 passed*",
]
)

def test_ignores_all(self, testdir):
"""Verify success when all errors are ignored."""
Expand All @@ -73,41 +75,49 @@ def test_ignores_all(self, testdir):
testdir.tmpdir.ensure("tests/hello.py")
result = testdir.runpytest("--flake8", "-s")
result.assert_outcomes(passed=1)
result.stdout.fnmatch_lines([
"*collected 1*",
"*xy.py .*",
"*1 passed*",
])
result.stdout.fnmatch_lines(
[
"*collected 1*",
"*xy.py .*",
"*1 passed*",
]
)

def test_w293w292(self, testdir, example):
result = testdir.runpytest(
"--flake8",
)
result.stdout.fnmatch_lines([
# "*plugins*flake8*",
"*W293*",
"*W292*",
])
result.stdout.fnmatch_lines(
[
# "*plugins*flake8*",
"*W293*",
"*W292*",
]
)
result.assert_outcomes(failed=1)

def test_mtime_caching(self, testdir, example):
testdir.tmpdir.ensure("hello.py")
result = testdir.runpytest(
"--flake8",
)
result.stdout.fnmatch_lines([
# "*plugins*flake8*",
"*W293*",
"*W292*",
])
result.stdout.fnmatch_lines(
[
# "*plugins*flake8*",
"*W293*",
"*W292*",
]
)
result.assert_outcomes(passed=1, failed=1)
result = testdir.runpytest(
"--flake8",
)
result.stdout.fnmatch_lines([
"*W293*",
"*W292*",
])
result.stdout.fnmatch_lines(
[
"*W293*",
"*W292*",
]
)
result.assert_outcomes(skipped=1, failed=1)
testdir.makeini("""
[pytest]
Expand All @@ -134,9 +144,11 @@ def f():
""",
)
result = testdir.runpytest("--flake8")
result.stdout.fnmatch_lines([
"*collected 1*",
])
result.stdout.fnmatch_lines(
[
"*collected 1*",
]
)
result.assert_outcomes(failed=1)


Expand All @@ -147,9 +159,11 @@ class AClass:
""")
p = p.write(p.read() + "\n")
result = testdir.runpytest("--flake8", "--verbose")
result.stdout.fnmatch_lines([
"*test_ok_verbose*",
])
result.stdout.fnmatch_lines(
[
"*test_ok_verbose*",
]
)
result.assert_outcomes(passed=1)


Expand All @@ -160,10 +174,12 @@ def test_hello():
#
""")
result = testdir.runpytest("--flake8", "-mflake8")
result.stdout.fnmatch_lines([
"*E201*",
"*1 failed*",
])
result.stdout.fnmatch_lines(
[
"*E201*",
"*1 failed*",
]
)
result.assert_outcomes(failed=1)


Expand Down

0 comments on commit cad5def

Please sign in to comment.