Mercurial > cpython-lru_cache-weakref
annotate Lib/test/test_resource.py @ 79675:c0a2294de787 2.7
Issue #16199: Backport 2to3 typo fix from 3.2.
| author | Chris Jerdonek <chris.jerdonek@gmail.com> |
|---|---|
| date | Thu, 11 Oct 2012 16:15:46 -0700 |
| parents | b36cb4602e21 |
| children | a4c85f9b8f58 |
| rev | line source |
|---|---|
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
1 import unittest |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
2 from test import test_support |
|
52491
f4c5e3a64be2
Change more tests to use import_module for the modules that
R. David Murray <rdmurray@bitdance.com>
parents:
45468
diff
changeset
|
3 import time |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
4 |
|
52491
f4c5e3a64be2
Change more tests to use import_module for the modules that
R. David Murray <rdmurray@bitdance.com>
parents:
45468
diff
changeset
|
5 resource = test_support.import_module('resource') |
|
23251
405b291c321d
Add tests for the recent resource module change.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
diff
changeset
|
6 |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
7 # This test is checking a few specific problem spots with the resource module. |
|
23251
405b291c321d
Add tests for the recent resource module change.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
diff
changeset
|
8 |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
9 class ResourceTest(unittest.TestCase): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
10 |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
11 def test_args(self): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
12 self.assertRaises(TypeError, resource.getrlimit) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
13 self.assertRaises(TypeError, resource.getrlimit, 42, 42) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
14 self.assertRaises(TypeError, resource.setrlimit) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
15 self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42) |
|
23251
405b291c321d
Add tests for the recent resource module change.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
diff
changeset
|
16 |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
17 def test_fsize_ismax(self): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
18 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
19 (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
20 except AttributeError: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
21 pass |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
22 else: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
23 # RLIMIT_FSIZE should be RLIM_INFINITY, which will be a really big |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
24 # number on a platform with large file support. On these platforms, |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
25 # we need to test that the get/setrlimit functions properly convert |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
26 # the number to a C long long and that the conversion doesn't raise |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
27 # an error. |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
28 self.assertEqual(resource.RLIM_INFINITY, max) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
29 resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max)) |
|
23251
405b291c321d
Add tests for the recent resource module change.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
diff
changeset
|
30 |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
31 def test_fsize_enforced(self): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
32 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
33 (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
34 except AttributeError: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
35 pass |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
36 else: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
37 # Check to see what happens when the RLIMIT_FSIZE is small. Some |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
38 # versions of Python were terminated by an uncaught SIGXFSZ, but |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
39 # pythonrun.c has been fixed to ignore that exception. If so, the |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
40 # write() should return EFBIG when the limit is exceeded. |
|
26618
9e751eee81f5
Patch #551960: Add check for setrlimit() support
Jason Tishler <jason@tishler.net>
parents:
24364
diff
changeset
|
41 |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
42 # At least one platform has an unlimited RLIMIT_FSIZE and attempts |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
43 # to change it raise ValueError instead. |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
44 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
45 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
46 resource.setrlimit(resource.RLIMIT_FSIZE, (1024, max)) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
47 limit_set = True |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
48 except ValueError: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
49 limit_set = False |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
50 f = open(test_support.TESTFN, "wb") |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
51 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
52 f.write("X" * 1024) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
53 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
54 f.write("Y") |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
55 f.flush() |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
56 # On some systems (e.g., Ubuntu on hppa) the flush() |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
57 # doesn't always cause the exception, but the close() |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
58 # does eventually. Try flushing several times in |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
59 # an attempt to ensure the file is really synced and |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
60 # the exception raised. |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
61 for i in range(5): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
62 time.sleep(.1) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
63 f.flush() |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
64 except IOError: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
65 if not limit_set: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
66 raise |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
67 if limit_set: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
68 # Close will attempt to flush the byte we wrote |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
69 # Restore limit first to avoid getting a spurious error |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
70 resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max)) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
71 finally: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
72 f.close() |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
73 finally: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
74 if limit_set: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
75 resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max)) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
76 test_support.unlink(test_support.TESTFN) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
77 |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
78 def test_fsize_toobig(self): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
79 # Be sure that setrlimit is checking for really large values |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
80 too_big = 10L**50 |
|
45279
eeef39a6f4dd
Backport test_resource fix from trunk to stop it crashing on Ubuntu
Nick Coghlan <ncoghlan@gmail.com>
parents:
45027
diff
changeset
|
81 try: |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
82 (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
83 except AttributeError: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
84 pass |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
85 else: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
86 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
87 resource.setrlimit(resource.RLIMIT_FSIZE, (too_big, max)) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
88 except (OverflowError, ValueError): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
89 pass |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
90 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
91 resource.setrlimit(resource.RLIMIT_FSIZE, (max, too_big)) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
92 except (OverflowError, ValueError): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
93 pass |
|
23251
405b291c321d
Add tests for the recent resource module change.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
diff
changeset
|
94 |
|
45479
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
95 def test_getrusage(self): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
96 self.assertRaises(TypeError, resource.getrusage) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
97 self.assertRaises(TypeError, resource.getrusage, 42, 42) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
98 usageself = resource.getrusage(resource.RUSAGE_SELF) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
99 usagechildren = resource.getrusage(resource.RUSAGE_CHILDREN) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
100 # May not be available on all systems. |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
101 try: |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
102 usageboth = resource.getrusage(resource.RUSAGE_BOTH) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
103 except (ValueError, AttributeError): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
104 pass |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
105 |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
106 def test_main(verbose=None): |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
107 test_support.run_unittest(ResourceTest) |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
108 |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
109 if __name__ == "__main__": |
|
40d269d6da9c
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
Andrew M. Kuchling <amk@amk.ca>
parents:
45279
diff
changeset
|
110 test_main() |
