From 9eb0f5ffaaeef4dfe8fe12f541bfa70a0724b702 Mon Sep 17 00:00:00 2001 From: jpic Date: Fri, 31 Jan 2020 19:28:09 +0100 Subject: [PATCH] Add TEST_REWRITE env var to rewrite tests --- tests/test_build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_build.py b/tests/test_build.py index d04cf20..fe3cd69 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -30,6 +30,8 @@ def script_test(name, *visitors): with open(path, 'w+') as f: f.write(result) raise Exception(f'Fixture created test_{name}.sh') + elif os.getenv('TEST_REWRITE') and os.path.exists(path): + os.unlink(path) with open(path, 'r') as f: expected = f.read() result = difflib.unified_diff(