mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Cleanup from patch #683257:
Add missing INCREFs and re-indent returns to be consistent. Add \n\ for lines in docstring Add a pathetic test Add docs
This commit is contained in:
parent
c4f4ca91e1
commit
2294c0d4ec
3 changed files with 46 additions and 4 deletions
26
Lib/test/test_imp.py
Normal file
26
Lib/test/test_imp.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
import imp
|
||||
import unittest
|
||||
from test_support import TestFailed
|
||||
|
||||
class ImpLock(unittest.TestCase):
|
||||
|
||||
# XXX this test is woefully inadequate, please fix me
|
||||
def testLock(self):
|
||||
LOOPS = 50
|
||||
for i in range(LOOPS):
|
||||
imp.acquire_lock()
|
||||
for i in range(LOOPS):
|
||||
imp.release_lock()
|
||||
|
||||
for i in range(LOOPS):
|
||||
try:
|
||||
imp.release_lock()
|
||||
except RuntimeError:
|
||||
pass
|
||||
else:
|
||||
raise TestFailed, \
|
||||
"release_lock() without lock should raise RuntimeError"
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_support.run_unittest(ImpLock)
|
Loading…
Add table
Add a link
Reference in a new issue