Skip to content

Commit 5ac2380

Browse files
committed
more clean test file removal
1 parent 07efd64 commit 5ac2380

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

qiita_client/tests/test_qiita_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,7 @@ def test_delete_file_from_central(self):
502502
with open(fp_test, 'w') as f:
503503
f.write('This is a testfile content\n')
504504
self.clean_up_files.append(fp_test)
505-
try:
506-
self.qclient.push_file_to_central(fp_test)
507-
except ForbiddenError:
508-
# previous test instances might not have cleaned this file
509-
# properly if ran with https protocol
510-
pass
505+
self.qclient.push_file_to_central(fp_test)
511506

512507
# sanity check that test file has been deposited correctly
513508
fp_obs = self.qclient.fetch_file_from_central(fp_test)
@@ -530,6 +525,12 @@ def test_delete_file_from_central(self):
530525
# qiita main filepath, returned by delete_file_from_central
531526
self.assertTrue(exists(fp_deleted))
532527

528+
# clean up test file directly after tests have passed
529+
if exists(fp_test):
530+
remove(fp_test)
531+
if exists(fp_obs):
532+
remove(fp_obs)
533+
533534

534535
if __name__ == '__main__':
535536
main()

0 commit comments

Comments
 (0)