Skip to content

Commit

Permalink
test: remove unnecessary file close
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Sep 17, 2024
1 parent 439f2e8 commit 85336c7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion test/gui/shared/scripts/bdd_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def hook(context):
+ context.title
+ "\n"
)
f.close()

# this path will be changed according to the user added to the client
# e.g.: /tmp/client-bdd/Alice
Expand Down
3 changes: 0 additions & 3 deletions test/gui/shared/scripts/helpers/FilesHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def can_read(resource):
read = False
try:
with open(resource, encoding="utf-8") as f:
f.close()
read = True
except:
pass
Expand All @@ -49,7 +48,6 @@ def can_write(resource):
write = False
try:
with open(resource, "w", encoding="utf-8") as f:
f.close()
write = True
except:
pass
Expand All @@ -59,7 +57,6 @@ def can_write(resource):
def read_file_content(file):
with open(file, "r", encoding="utf-8") as f:
content = f.read()
f.close()
return content


Expand Down
1 change: 0 additions & 1 deletion test/gui/shared/scripts/helpers/SetupClientHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def generate_account_config(users, space='Personal'):

with open(get_config('clientConfigFile'), 'a+', encoding='utf-8') as config_file:
config_file.write(user_setting)
config_file.close()

return sync_paths

Expand Down
2 changes: 0 additions & 2 deletions test/gui/shared/scripts/helpers/StacktraceHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def getCoredumps():
# read coredump location
with open('/proc/sys/kernel/core_pattern', 'r', encoding='utf-8') as f:
coredumpPath = f.read().strip('\n')
f.close()

# yields something like: /tmp/core-*-*-*-*
coredumpFilePattern = re.sub(r'%[a-zA-Z]{1}', '*', coredumpPath)
Expand All @@ -35,7 +34,6 @@ def generateStacktrace(scenario_title, coredumps):
# save stacktrace to a file
with open(stacktrace_file, 'a', encoding='utf-8') as f:
f.write(stacktrace)
f.close()


def parseStacktrace(coredumpFile):
Expand Down
2 changes: 0 additions & 2 deletions test/gui/shared/steps/file_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def createFileWithSize(filename, filesize, isTempFolder=False):
def writeFile(resource, content):
with open(prefix_path_namespace(resource), 'w', encoding='utf-8') as f:
f.write(content)
f.close()


def waitAndWriteFile(path, content):
Expand Down Expand Up @@ -148,7 +147,6 @@ def step(context, filePath):
filePath = getResourcePath(filePath)
with open(filePath, 'r', encoding='utf-8') as f:
contents = f.read()
f.close()
test.compare(
expected,
contents,
Expand Down

0 comments on commit 85336c7

Please sign in to comment.