X-Git-Url: https://git.phdru.name/?p=ppu.git;a=blobdiff_plain;f=tests%2Ftest_cmp.py;h=b70183709577aae7aeb5eface0d34b59eb6b50d4;hp=49b48ac133e7fe7622425628e84a1fe4f77ffa34;hb=e78080336c7f7b636cbc6d168bac1d54cec41a09;hpb=c6e98694274a9c3e09fa3192a5f247607081c1ae diff --git a/tests/test_cmp.py b/tests/test_cmp.py index 49b48ac..b701837 100755 --- a/tests/test_cmp.py +++ b/tests/test_cmp.py @@ -1,11 +1,9 @@ #! /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 @@ -15,17 +13,6 @@ 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): with open(name, 'w') as fp: fp.write(content)