Skip to content

Commit 91661a0

Browse files
committed
Fix linting
1 parent 03e78ff commit 91661a0

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

src/_pytest/config/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,7 @@ def _try_load_conftest(
526526

527527
@lru_cache(maxsize=128)
528528
def _getconftestmodules(
529-
self,
530-
path: Path,
531-
importmode: Union[str, ImportMode],
532-
rootpath: Path
529+
self, path: Path, importmode: Union[str, ImportMode], rootpath: Path
533530
) -> List[types.ModuleType]:
534531
if self._noconftest:
535532
return []
@@ -569,10 +566,7 @@ def _rget_with_confmod(
569566
raise KeyError(name)
570567

571568
def _importconftest(
572-
self,
573-
conftestpath: Path,
574-
importmode: Union[str, ImportMode],
575-
rootpath: Path
569+
self, conftestpath: Path, importmode: Union[str, ImportMode], rootpath: Path
576570
) -> types.ModuleType:
577571
# Use a resolved Path object as key to avoid loading the same conftest
578572
# twice with build systems that create build directories containing

src/_pytest/doctest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ def _find(
534534

535535
if self.path.name == "conftest.py":
536536
module = self.config.pluginmanager._importconftest(
537-
self.path, self.config.getoption("importmode"), rootpath=self.config.rootpath
537+
self.path,
538+
self.config.getoption("importmode"),
539+
rootpath=self.config.rootpath,
538540
)
539541
else:
540542
try:

src/_pytest/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ def _in_venv(path: Path) -> bool:
378378

379379

380380
def pytest_ignore_collect(fspath: Path, config: Config) -> Optional[bool]:
381-
ignore_paths = config._getconftest_pathlist("collect_ignore", path=fspath.parent, rootpath=config.rootpath)
381+
ignore_paths = config._getconftest_pathlist(
382+
"collect_ignore", path=fspath.parent, rootpath=config.rootpath
383+
)
382384
ignore_paths = ignore_paths or []
383385
excludeopt = config.getoption("ignore")
384386
if excludeopt:

testing/test_pathlib.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,7 @@ def test_invalid_path(self, tmp_path: Path) -> None:
273273
def simple_module(self, tmp_path: Path) -> Path:
274274
fn = tmp_path / "_src/tests/mymod.py"
275275
fn.parent.mkdir(parents=True)
276-
fn.write_text(
277-
dedent(
278-
"""
279-
def foo(x): return 40 + x
280-
"""
281-
)
282-
)
276+
fn.write_text("def foo(x): return 40 + x")
283277
return fn
284278

285279
def test_importmode_importlib(self, simple_module: Path, tmp_path: Path) -> None:

0 commit comments

Comments
 (0)