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