summaryrefslogtreecommitdiff
path: root/mock/tests/__main__.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-10 10:50:14 +1200
committerRobert Collins <rbtcollins@hp.com>2015-07-10 10:51:04 +1200
commit51346f488cd28e6a9a6727901922a4cff2df3714 (patch)
tree447a63cde876788a552033b1c11415c535f84c04 /mock/tests/__main__.py
parente7c30fb1e98a8751cbe7ba3aa116b131b07364f3 (diff)
downloadmock-51346f488cd28e6a9a6727901922a4cff2df3714.tar.gz
Convert to a package, use pbr, update metadata.
In particular this changes the author from Michael to the testing-cabal group.
Diffstat (limited to 'mock/tests/__main__.py')
-rw-r--r--mock/tests/__main__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/mock/tests/__main__.py b/mock/tests/__main__.py
new file mode 100644
index 0000000..45c633a
--- /dev/null
+++ b/mock/tests/__main__.py
@@ -0,0 +1,18 @@
+import os
+import unittest
+
+
+def load_tests(loader, standard_tests, pattern):
+ # top level directory cached on loader instance
+ this_dir = os.path.dirname(__file__)
+ pattern = pattern or "test*.py"
+ # We are inside unittest.test.testmock, so the top-level is three notches up
+ top_level_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir)))
+ package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
+ top_level_dir=top_level_dir)
+ standard_tests.addTests(package_tests)
+ return standard_tests
+
+
+if __name__ == '__main__':
+ unittest.main()