[mousetrap/gnome3-wip: 23/240] Added basic test runner



commit 7bfc4606370198158f13e5d537ea3ebdd99c62cd
Author: Kevin Brown <kbrown rediker com>
Date:   Thu Apr 17 15:03:39 2014 -0400

    Added basic test runner
    
    This add a basic python script that uses `unittest` and the
    associated `TextTestRunner` and `TestLoader` classes to find and
    run all of the tests in MouseTrap.
    
    The `TestLoader` that is included with `unittest` discovers tests
    that are located within Python modules that start with "test", so
    `test_[whatever].py` will be detected and loaded.
    
    `TextTestRunner` gives a basic textual output for tests and is
    included by default with `unittest`.

 runtests.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/runtests.py b/runtests.py
new file mode 100644
index 0000000..7667ae0
--- /dev/null
+++ b/runtests.py
@@ -0,0 +1,9 @@
+from unittest import TestLoader
+from unittest.runner import TextTestRunner
+
+test_loader = TestLoader()
+tests = test_loader.discover('src/mousetrap')
+
+test_runner = TextTestRunner()
+
+test_runner.run(tests)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]