From 29ee9411c947b3777820006dbd9bc283adefda9f Mon Sep 17 00:00:00 2001 From: Stephen Akiki Date: Thu, 20 Jan 2022 13:18:14 -0500 Subject: [PATCH] Check before and after --- test/test_generate.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/test_generate.py b/test/test_generate.py index bee4ca2ed..b084ec2f8 100755 --- a/test/test_generate.py +++ b/test/test_generate.py @@ -9,13 +9,14 @@ # List of directories that contain generate.go files list_of_directories=["../idb/postgres/internal/schema"] + +first = check_output(["git status --porcelain"], shell=True).strip().decode('UTF-8') + for dir in list_of_directories: os.system("/usr/local/go/bin/go generate {}".format(dir)) -out = check_output(["git status --porcelain | wc -l"], shell=True).strip().decode('UTF-8') +second = check_output(["git status --porcelain"], shell=True).strip().decode('UTF-8') -if out != "0": - print("Number of files modified was not 0. It was {}".format(out)) - out = check_output(["git status --porcelain"], shell=True).strip().decode('UTF-8') - print("Output of 'git status --porcelain':\n {}".format(out)) +if first != second: + print("Output of 'git status --porcelain':\n {}".format(second)) sys.exit(1) \ No newline at end of file