Skip to content

Commit c8ac7ba

Browse files
d-w-moorekorydraughn
authored andcommitted
[#711] restore balancing del statement.
An object, referenced as cls.logins in the setUpClass method of some of the test classes, was delayed too much in its destruction, which in earlier Python releases (3.8 and 3.9, at least) prevented proper test cleanup.
1 parent ad71767 commit c8ac7ba

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

irods/test/collection_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ def setUpClass(cls):
3535

3636
@classmethod
3737
def tearDownClass(cls):
38-
# TODO(#553): Skipping this will result in an interpreter seg fault for Py3.6 but not 3.11; why?
38+
# As in Python 3.8 and previous, Python 3.9.19 will react badly to leaving out the following del statement during test runs. Although
39+
# as of 3.9.19 the segmentation fault no longer occurs, we still get an unsuccessful destruct, so the __del__ call in cls.logins
40+
# fails to do all of the work for proper test teardown. This happens because the object is being garbage collected at a point in time
41+
# when the Python interpreter is finalizing.
3942
del cls.logins
4043

4144
def setUp(self):

irods/test/data_obj_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,11 @@ def setUpClass(cls):
917917

918918
@classmethod
919919
def tearDownClass(cls):
920-
pass
920+
# As in Python 3.8 and previous, Python 3.9.19 will react badly to leaving out the following del statement during test runs. Although
921+
# as of 3.9.19 the segmentation fault no longer occurs, we still get an unsuccessful destruct, so the __del__ call in cls.logins
922+
# fails to do all of the work for proper test teardown. This happens because the object is being garbage collected at a point in time
923+
# when the Python interpreter is finalizing.
924+
del cls.logins
921925

922926
def _data_object_and_associated_ticket(
923927
self,

0 commit comments

Comments
 (0)