summaryrefslogtreecommitdiff
path: root/tests/test_functional.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_functional.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_functional.py')
-rw-r--r--tests/test_functional.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_functional.py b/tests/test_functional.py
index 015b3cfca..9e558723a 100644
--- a/tests/test_functional.py
+++ b/tests/test_functional.py
@@ -109,6 +109,8 @@ if __name__ == "__main__":
if UPDATE_OPTION in sys.argv:
UPDATE_FILE.touch()
sys.argv.remove(UPDATE_OPTION)
- pytest.main(sys.argv)
- if UPDATE_FILE.exists():
- UPDATE_FILE.unlink()
+ try:
+ pytest.main(sys.argv)
+ finally:
+ if UPDATE_FILE.exists():
+ UPDATE_FILE.unlink()