diff --git a/tests/test_cli.py b/tests/test_cli.py
index 1cb2e51f294e7f3d0599905f663c8522a6eb2d77..ef40055cf51781976bb5f07757cbf48406ecde78 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -36,4 +36,6 @@ def test_cli_gpu(file, fmt, convert_to_freq):
         suffix = ".semitones." + fmt
         option = " -F"
     os.system(f"pesto {file} --gpu 0 --export_format " + fmt + option)
-    assert os.path.isfile(file.rsplit('.', 1)[0] + suffix)
+    out_file = file.rsplit('.', 1)[0] + suffix
+    assert os.path.isfile(out_file)
+    os.unlink(out_file)