]> git.phdru.name Git - ppu.git/blobdiff - tests/test_cmp.py
Cleanup: Fix flake8 E722 do not use bare except
[ppu.git] / tests / test_cmp.py
index 49b48ac133e7fe7622425628e84a1fe4f77ffa34..efdd43ae6dc24af4a4200f815f074bd1b8ead49c 100755 (executable)
@@ -1,29 +1,11 @@
 #! /usr/bin/env python
 
-import os
-import shutil
 import subprocess
 import sys
-from tempfile import mkdtemp
-from find_in_path import find_in_path
+from ppu_tu import setup, teardown, find_in_path  # noqa
 
 
-tmp_dir = None
-
 test_prog_path = find_in_path('cmp.py')
-if not test_prog_path:
-    sys.exit("Cannot find cmp.py in %s" % os.environ["PATH"])
-
-
-def setup():
-    global tmp_dir
-    tmp_dir = mkdtemp()
-    os.chdir(tmp_dir)
-
-
-def teardown():
-    os.chdir(os.sep)  # To the root of the FS
-    shutil.rmtree(tmp_dir)
 
 
 def create_file(name, content):