Skip to content
Snippets Groups Projects
Commit a7fda873 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

STY: use closing statement

parent f2a039a6
No related branches found
No related tags found
No related merge requests found
......@@ -50,9 +50,8 @@ def setup_module():
def setup():
upload_file = open("test.dat", "w")
with open("test.dat", "w") as upload_file:
upload_file.write("hello world\n")
upload_file.close()
os.makedirs("testfolder/subfolder")
with open("testfolder/test1.dat", "w") as upload_file:
upload_file.write("hello world\n")
......@@ -397,9 +396,8 @@ def test_consistency_file_was_modified():
@with_setup(setup, teardown)
def test_consistency_file_does_not_exist():
try:
upload_file = open("test.dat", "w")
with open("test.dat", "w") as upload_file:
upload_file.write("hello world\n")
upload_file.close()
file_ = models.File(name="TestConsistency1",
description="Testfile Desc",
path="debug/test_file_storage_consistency",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment