test_contextlib wasn't actually being run by regrtest.py. Or more precisely,

it was being run, but no tests were actually executed!
This commit is contained in:
Phillip J. Eby 2006-04-10 18:33:17 +00:00
parent 93149d935d
commit bd0c10f7c9
1 changed files with 9 additions and 1 deletions

View File

@ -2,12 +2,14 @@
from __future__ import with_statement
import sys
import os
import decimal
import tempfile
import unittest
import threading
from contextlib import * # Tests __all__
from test.test_support import run_suite
class ContextManagerTestCase(unittest.TestCase):
@ -327,5 +329,11 @@ class DecimalContextTestCase(unittest.TestCase):
self.fail("Didn't raise ZeroDivisionError")
# This is needed to make the test actually run under regrtest.py!
def test_main():
run_suite(
unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__])
)
if __name__ == "__main__":
unittest.main()
test_main()