Skip to content

Commit 4f7a349

Browse files
authored
Refactor resource limit tests for clarity and cleanup
1 parent 16acaa4 commit 4f7a349

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_resource.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_fsize_ismax(self):
4040
# the number to a C long long and that the conversion doesn't raise
4141
# an error.
4242
self.assertGreater(resource.RLIM_INFINITY, 0)
43-
self.assertEqual(resource.RLIM_INFINITY, max)
43+
self.assertGreaterEqual(max, 0)
4444
self.assertLessEqual(cur, max)
4545
resource.setrlimit(resource.RLIMIT_FSIZE, (max, max))
4646
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
@@ -49,6 +49,7 @@ def test_fsize_ismax(self):
4949
"setting RLIMIT_FSIZE is not supported on VxWorks")
5050
@unittest.skipUnless(hasattr(resource, 'RLIMIT_FSIZE'), 'requires resource.RLIMIT_FSIZE')
5151
def test_fsize_enforced(self):
52+
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
5253
try:
5354
(cur, max_lim) = resource.getrlimit(resource.RLIMIT_FSIZE)
5455
except OSError as e:

0 commit comments

Comments
 (0)