summaryrefslogtreecommitdiff
path: root/tests/test_func.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-01-01 15:58:28 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-01-01 16:42:28 +0100
commit9f0677827af88dd56e6a905d2d671bf2debd2ebf (patch)
treedb053d2136ce42e716f5a918cd516dd143ac7d4d /tests/test_func.py
parent00868cb9df8119da054e7f1d37be3e474e5e6b77 (diff)
downloadpylint-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.py8
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()