[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-04-21 18:24:57 +00:00
parent eea8bab283
commit e5aacc6ac9
1 changed files with 6 additions and 6 deletions

View File

@ -69,27 +69,27 @@ def iterparentnodeids(nodeid: str) -> Iterator[str]:
# The root Session node - always present.
yield ""
if nodeid == '':
if nodeid == "":
return
if nodeid.startswith('::'):
if nodeid.startswith("::"):
# Weird case of '::x' (no path)
yield nodeid
return
path, sep, node = nodeid.partition('::')
path, sep, node = nodeid.partition("::")
sections = path.split(SEP)
for i, _ in enumerate(sections, start=1):
yield SEP.join(sections[:i])
if sep == '':
if sep == "":
# Only a path
return
nodes = node.split('::')
nodes = node.split("::")
for i, _ in enumerate(nodes, start=1):
yield '::'.join([path] + nodes[:i])
yield "::".join([path] + nodes[:i])
def _check_path(path: Path, fspath: LEGACY_PATH) -> None: