Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 27, 2023
1 parent 62f00cc commit afa8212
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,8 @@ def collect(self) -> Iterable[Union[nodes.Item, nodes.Collector]]:
this_path = self.path.parent

# Always collect the __init__ first.
if (
self.session.isinitpath(self.path)
or path_matches_patterns(self.path, self.config.getini("python_files"))
if self.session.isinitpath(self.path) or path_matches_patterns(
self.path, self.config.getini("python_files")
):
yield Module.from_parent(self, path=self.path)

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
def test_init(): pass
def test_init():
pass
2 changes: 1 addition & 1 deletion testing/python/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ def test_package_collection_init_given_as_argument(pytester: Pytester) -> None:
p = pytester.copy_example("collect/package_init_given_as_arg")
items, hookrecorder = pytester.inline_genitems(p / "pkg" / "__init__.py")
assert len(items) == 1
assert items[0].name == 'test_init'
assert items[0].name == "test_init"


def test_package_with_modules(pytester: Pytester) -> None:
Expand Down

0 comments on commit afa8212

Please sign in to comment.