Enable flake8-pie

This commit is contained in:
Ran Benita 2024-02-09 11:08:33 +02:00
parent d02618d173
commit d1ee6d154f
5 changed files with 6 additions and 7 deletions

View File

@ -102,6 +102,7 @@ select = [
"UP", # pyupgrade
"RUF", # ruff
"W", # pycodestyle
"PIE", # flake8-pie
]
ignore = [
# bugbear ignore

View File

@ -452,7 +452,7 @@ class LocalPath:
def ensure_dir(self, *args):
"""Ensure the path joined with args is a directory."""
return self.ensure(*args, **{"dir": True})
return self.ensure(*args, dir=True)
def bestrelpath(self, dest):
"""Return a string which is a relative path from self

View File

@ -601,7 +601,7 @@ class TestAssert_reprcompare:
def test_list_dont_wrap_strings(self) -> None:
long_a = "a" * 10
l1 = ["a"] + [long_a for _ in range(0, 7)]
l1 = ["a"] + [long_a for _ in range(7)]
l2 = ["should not get wrapped"]
diff = callequal(l1, l2, verbose=True)
assert diff == [

View File

@ -1231,8 +1231,7 @@ def test_plugin_loading_order(pytester: Pytester) -> None:
import myplugin
assert myplugin.terminal_plugin == [False, True]
""",
**{
"myplugin": """
myplugin="""
terminal_plugin = []
def pytest_configure(config):
@ -1241,8 +1240,7 @@ def test_plugin_loading_order(pytester: Pytester) -> None:
def pytest_sessionstart(session):
config = session.config
terminal_plugin.append(bool(config.pluginmanager.get_plugin("terminalreporter")))
"""
},
""",
)
pytester.syspathinsert()
result = pytester.runpytest("-p", "myplugin", str(p1))

View File

@ -74,7 +74,7 @@ class TestEvaluation:
"""@pytest.mark.skipif("not hasattr(os, 'murks')")""",
"""@pytest.mark.skipif(condition="hasattr(os, 'murks')")""",
]
for i in range(0, 2):
for i in range(2):
item = pytester.getitem(
f"""
import pytest