@@ -35,13 +35,10 @@ def test_args(self):
3535 @unittest .skipUnless (hasattr (resource , 'RLIMIT_FSIZE' ), 'requires resource.RLIMIT_FSIZE' )
3636 def test_fsize_ismax (self ):
3737 (cur , max ) = resource .getrlimit (resource .RLIMIT_FSIZE )
38- # RLIMIT_FSIZE should be RLIM_INFINITY, which will be a really big
39- # number on a platform with large file support. On these platforms,
40- # we need to test that the get/setrlimit functions properly convert
41- # the number to a C long long and that the conversion doesn't raise
42- # an error.
43- self .assertGreater (resource .RLIM_INFINITY , 0 )
44- self .assertEqual (resource .RLIM_INFINITY , max )
38+ # Test that the get/setrlimit functions properly handle large values
39+ # for RLIMIT_FSIZE. On platforms with large file support, max may be
40+ # RLIM_INFINITY, but on systems with file size restrictions, it may
41+ # be a smaller value.
4542 self .assertLessEqual (cur , max )
4643 resource .setrlimit (resource .RLIMIT_FSIZE , (max , max ))
4744 resource .setrlimit (resource .RLIMIT_FSIZE , (cur , max ))
@@ -155,7 +152,6 @@ def expected(cur):
155152 "setting RLIMIT_FSIZE is not supported on VxWorks" )
156153 @unittest .skipUnless (hasattr (resource , 'RLIMIT_FSIZE' ), 'requires resource.RLIMIT_FSIZE' )
157154 def test_fsize_negative (self ):
158- self .assertGreater (resource .RLIM_INFINITY , 0 )
159155 (cur , max ) = resource .getrlimit (resource .RLIMIT_FSIZE )
160156 for value in - 5 , - 2 ** 31 , - 2 ** 32 - 5 , - 2 ** 63 , - 2 ** 64 - 5 , - 2 ** 1000 :
161157 with self .subTest (value = value ):
0 commit comments