diff options
author | Michael Foord <michael@voidspace.org.uk> | 2012-03-14 19:24:34 (GMT) |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2012-03-14 19:24:34 (GMT) |
commit | 345266aa7e7fdbb1bbf3ffd244caff39406d46d2 (patch) | |
tree | 4b770dfa5808bea3c150fcb6e8801d2d4d9d6ba8 /Lib/unittest/test/testmock/__init__.py | |
parent | 8d8f11049265f4e53b2d97f5caa73c4ca0ee7875 (diff) | |
download | cpython-345266aa7e7fdbb1bbf3ffd244caff39406d46d2.zip cpython-345266aa7e7fdbb1bbf3ffd244caff39406d46d2.tar.gz cpython-345266aa7e7fdbb1bbf3ffd244caff39406d46d2.tar.bz2 |
PEP 417: Adding unittest.mock
Diffstat (limited to 'Lib/unittest/test/testmock/__init__.py')
-rw-r--r-- | Lib/unittest/test/testmock/__init__.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/__init__.py b/Lib/unittest/test/testmock/__init__.py new file mode 100644 index 0000000..87d7ae9 --- /dev/null +++ b/Lib/unittest/test/testmock/__init__.py @@ -0,0 +1,17 @@ +import os +import sys +import unittest + + +here = os.path.dirname(__file__) +loader = unittest.defaultTestLoader + +def load_tests(*args): + suite = unittest.TestSuite() + for fn in os.listdir(here): + if fn.startswith("test") and fn.endswith(".py"): + modname = "unittest.test.testmock." + fn[:-3] + __import__(modname) + module = sys.modules[modname] + suite.addTest(loader.loadTestsFromModule(module)) + return suite |