diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-01-01 15:58:28 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-01-01 16:42:28 +0100 |
commit | 9f0677827af88dd56e6a905d2d671bf2debd2ebf (patch) | |
tree | db053d2136ce42e716f5a918cd516dd143ac7d4d /tests/test_func.py | |
parent | 00868cb9df8119da054e7f1d37be3e474e5e6b77 (diff) | |
download | pylint-git-9f0677827af88dd56e6a905d2d671bf2debd2ebf.tar.gz |
Actually remove the file even if the tests failed
Following review, see https://github.com/PyCQA/pylint/pull/4004\#discussion_r550774984
Diffstat (limited to 'tests/test_func.py')
-rw-r--r-- | tests/test_func.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_func.py b/tests/test_func.py index 2f6231f87..1fb4ee0f8 100644 --- a/tests/test_func.py +++ b/tests/test_func.py @@ -168,6 +168,8 @@ if __name__ == "__main__": if len(sys.argv) > 1: FILTER_RGX = sys.argv[1] del sys.argv[1] - pytest.main(sys.argv) - if UPDATE_FILE.exists(): - UPDATE_FILE.unlink() + try: + pytest.main(sys.argv) + finally: + if UPDATE_FILE.exists(): + UPDATE_FILE.unlink() |