Skip to content

Commit

Permalink
Add a shell command which tests for leftover temp files
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Jul 2, 2024
1 parent df08555 commit 83a4d71
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,21 @@ env.OPTS = """
--cov-context=test
"""

[tool.poe.tasks.check-temp-files]
help = "Run each test module one by one and check for leftover temp files"
shell = """
setopt nullglob
for file in test/**/*.py; do
print Temp files created by $file && poe test $file &>/dev/null
tempfiles=(/tmp/**/tmp* /tmp/beets/**/*)
if (( $#tempfiles )); then
print -l $'\t'$^tempfiles
rm -r --interactive=never $tempfiles &>/dev/null
fi
done
"""
interpreter = "zsh"

[tool.black]
line-length = 80
target-version = ["py38", "py39", "py310", "py311"]
Expand Down

0 comments on commit 83a4d71

Please sign in to comment.