blob: ebecf8203b3a761b892ed8ebd9c3492fa733a415 [file] [log] [blame]
Neal Norwitz2294c0d2003-02-12 23:02:21 +00001
2import imp
3import unittest
4from test_support import TestFailed
5
6class ImpLock(unittest.TestCase):
7
8 # XXX this test is woefully inadequate, please fix me
9 def testLock(self):
10 LOOPS = 50
11 for i in range(LOOPS):
12 imp.acquire_lock()
13 for i in range(LOOPS):
14 imp.release_lock()
15
16 for i in range(LOOPS):
17 try:
18 imp.release_lock()
19 except RuntimeError:
20 pass
21 else:
22 raise TestFailed, \
23 "release_lock() without lock should raise RuntimeError"
24
25if __name__ == "__main__":
26 test_support.run_unittest(ImpLock)