Add TEST_REWRITE env var to rewrite tests
This commit is contained in:
parent
3515dd2590
commit
9eb0f5ffaa
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user