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:
Neal Norwitz 2003-02-12 23:02:21 +00:00
parent c4f4ca91e1
commit 2294c0d4ec
3 changed files with 46 additions and 4 deletions

26
Lib/test/test_imp.py Normal file
View 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)