Starting with Python 3.6, it's possible to pass a PosixPath to the
os.remove function instead of having to use the .name attribute.
# Clean up any previous test output
for f in pathlib.Path(".").glob("capture_*.log"):
# Clean up any previous test output
for f in pathlib.Path(".").glob("capture_*.log"):
- # have to use .name here since remove() doesn't support passing a
- # PosixPath argument until Python3.6
- os.remove(f.name)
for d in ("data", "var"):
shutil.rmtree(d, ignore_errors=True)
for d in ("data", "var"):
shutil.rmtree(d, ignore_errors=True)