diff options
| author | Neal Norwitz <nnorwitz@gmail.com> | 2003-02-12 23:02:21 +0000 |
|---|---|---|
| committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-02-12 23:02:21 +0000 |
| commit | 9e2cd9709312997daee4d721b0079e3da902b0f0 (patch) | |
| tree | 017b92b6778abad8af65614f89353b6f9fe1b4e0 /Lib/test/test_imp.py | |
| parent | e438ab725692ca80d12e019f77d855b9e27b7ab0 (diff) | |
| download | cpython-9e2cd9709312997daee4d721b0079e3da902b0f0.tar.gz | |
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
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 0000000000..ebecf8203b --- /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) |
