From 60bcbe05e3c6ae1bb6bc7b1837387d4e30cfdd50 Mon Sep 17 00:00:00 2001 From: Jordan <21129425+ItIsJordan@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:54:55 +0100 Subject: [PATCH] Pylint fix Fixes pylint error around use of open() for files --- tests/test_submission.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_submission.py b/tests/test_submission.py index ed30b5a9..6bee2c01 100644 --- a/tests/test_submission.py +++ b/tests/test_submission.py @@ -75,9 +75,9 @@ def test_create_files(self): testdir = tmp_directory_name() testpath = "./testfile.txt" - # Create test file and set cleanup - f = open(testpath, "a") - f.close() + with open(testpath, "a", encoding="utf-8") as f: + f.close() + self.addCleanup(os.remove, testpath) # Create submission and set values for testing