diff options
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r-- | Lib/test/test_imp.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py new file mode 100644 index 0000000..ebecf82 --- /dev/null +++ b/Lib/test/test_imp.py @@ -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) |