Source code for nxpy.test.test

# nxpy.test package ----------------------------------------------------------

# Copyright Nicola Musatti 2008 - 2012
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See http://sourceforge.net/nxpy for library home page. ---------------------

r"""
Unittest utility functions.

"""

import sys
import unittest

[docs]def testModules(*modules): r"""Runs all tests defined in the given 'modules'.""" loader = unittest.TestLoader() loader.sortTestMethodsUsing = None suite = unittest.TestSuite() for m in modules: suite.addTests(loader.loadTestsFromModule(sys.modules[m])) unittest.TextTestRunner(verbosity=2).run(suite)
[docs]def testClasses(*classes): r"""Runs all tests defined in the given 'classes'.""" loader = unittest.TestLoader() loader.sortTestMethodsUsing = None suite = unittest.TestSuite() for c in classes: suite.addTests(loader.loadTestsFromTestCase(c)) unittest.TextTestRunner(verbosity=2).run(suite)

This Project