Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ popular Python development tools in their default locations, along with
Python bytecode. The following topics are currently covered:

- Cache (general purpose folder for several tools, e.g. Python eggs, legacy Pytest)
- Coverage (coverage database, and supported file formats)
- Coverage (coverage database, also of parallel runs, and supported file formats)
- Packaging (build files and folders)
- Pytest (build files and folders)
- Ruff (ruff cache folder)
Expand Down
1 change: 1 addition & 0 deletions pyclean/debris.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
],
'coverage': [
'.coverage',
'.coverage.*.pid*.X*',
'coverage.json',
'coverage.lcov',
'coverage.xml',
Expand Down
21 changes: 21 additions & 0 deletions tests/test_debris.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ def test_debris_recursive():
assert dir_nested_topic.parent.exists()


def test_debris_coverage_parallel_data_files():
"""
Are the data files of parallel coverage runs deleted, but not the
coverage configuration?
"""
with TemporaryDirectory() as tmp:
directory = Path(tmp)
data_files = [
directory / '.coverage.myhost.pid1234.XqzCbEdx',
directory / '.coverage.myhost.pid1234.XqzCbEdx.Ha0jIIxXkNjh',
]
config_file = directory / '.coveragerc'
for file in [*data_files, config_file]:
file.touch()

remove_debris_for('coverage', directory)

assert not any(file.exists() for file in data_files)
assert config_file.exists()


def test_detect_debris_in_directory():
"""
Does ``detect_debris_in_directory()`` identify debris artifacts?
Expand Down
Loading