summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dbm.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-03-03 04:19:29 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-03-03 04:19:29 (GMT)
commit7dbd91811d87b75cb43441ed6e356232bcf60d28 (patch)
tree8a6d0ac4e7c4adb7e724a1274e24d83f5b8e7481 /Lib/test/test_dbm.py
parent963c80fd45d8c94d15ea4085ce200365018a1556 (diff)
downloadcpython-7dbd91811d87b75cb43441ed6e356232bcf60d28.zip
cpython-7dbd91811d87b75cb43441ed6e356232bcf60d28.tar.gz
cpython-7dbd91811d87b75cb43441ed6e356232bcf60d28.tar.bz2
Add test_main() functions to various tests where it was simple to do. Done so
that regrtest can execute the test_main() directly instead of relying on import side-effects.
Diffstat (limited to 'Lib/test/test_dbm.py')
-rwxr-xr-xLib/test/test_dbm.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
index 4da0932..6b57efb 100755
--- a/Lib/test/test_dbm.py
+++ b/Lib/test/test_dbm.py
@@ -43,12 +43,18 @@ def test_modes():
d = dbm.open(filename, 'n')
d.close()
-cleanup()
-try:
- test_keys()
- test_modes()
-except:
+def test_main():
cleanup()
- raise
+ try:
+ test_keys()
+ test_modes()
+ except:
+ cleanup()
+ raise
-cleanup()
+ cleanup()
+
+
+
+if __name__ == '__main__':
+ test_main()