Changeset 391 for python/trunk/Lib/test/test_resource.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_resource.py
r2 r391 1 1 import unittest 2 2 from test import test_support 3 import time 3 4 4 import resource 5 import time 5 resource = test_support.import_module('resource') 6 6 7 7 # This test is checking a few specific problem spots with the resource module. … … 104 104 pass 105 105 106 # Issue 6083: Reference counting bug 107 def test_setrusage_refcount(self): 108 try: 109 limits = resource.getrlimit(resource.RLIMIT_CPU) 110 except AttributeError: 111 pass 112 else: 113 class BadSequence: 114 def __len__(self): 115 return 2 116 def __getitem__(self, key): 117 if key in (0, 1): 118 return len(tuple(range(1000000))) 119 raise IndexError 120 121 resource.setrlimit(resource.RLIMIT_CPU, BadSequence()) 122 106 123 def test_main(verbose=None): 107 124 test_support.run_unittest(ResourceTest)
Note:
See TracChangeset
for help on using the changeset viewer.