You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
File
cov-bug.py
frompathlibimportPathfromtempfileimportTemporaryDirectoryfromtypingimportGenerator, Listdefrecurse_artifacts(artifacts: List[str], root: Path) ->Generator[Path, None, None]:
forartifactinartifacts:
artifact=Path(artifact)
ifnotartifact.is_absolute():
artifact=root/artifactifartifact.is_file():
yieldartifactelifartifact.is_dir():
yieldfromartifact.iterdir()
defmain():
withTemporaryDirectory() asd:
project_dir=Path(d).resolve()
build_dir=project_dir/'dist'build_dir.mkdir()
absolute_path=project_dir/'absolute.whl'absolute_path.touch()
(build_dir/'test.tar.gz').touch()
(build_dir/'test.txt').touch()
(build_dir/'test.whl').touch()
# Turning generator into list also fails:# for artifact in list(recurse_artifacts(['dist', str(absolute_path)], project_dir)):forartifactinrecurse_artifacts(['dist', str(absolute_path)], project_dir):
ifartifact.name.endswith('.whl'):
print('found wheel')
elifartifact.name.endswith('.tar.gz'):
print('found sdist')
else:
# print('skipping')continueprint('uploading')
if__name__=='__main__':
main()
Command
$ coverage run cov-bug.py && coverage report --show-missing
found sdist
uploading
found wheel
uploading
found wheel
uploading
Name Stmts Miss Cover Missing
------------------------------------------
cov-bug.py 31 1 97% 39
------------------------------------------
TOTAL 31 1 97%
Additional context
The branch is discovered if you uncomment print('skipping')
The text was updated successfully, but these errors were encountered:
Reproduce
System
File
cov-bug.py
Command
Additional context
The branch is discovered if you uncomment
print('skipping')
The text was updated successfully, but these errors were encountered: