How to use the green.config.default_args function in green

To help you get started, we’ve selected a few green examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laike9m / ezcf / setup.py View on Github external
import sys
        import unittest

        setup_file = sys.modules["__main__"].__file__
        setup_dir = os.path.abspath(os.path.dirname(setup_file))
        tests = unittest.TestLoader().discover(
            os.path.join(setup_dir, "tests"), pattern="*.py"
        )
        try:
            # https://github.com/CleanCut/green/issues/50
            from green.runner import run
            from green.suite import GreenTestSuite
            from green.config import default_args

            default_args.verbose = 3
            run(GreenTestSuite(tests), sys.stdout, default_args)
        except ImportError:
            unittest.TextTestRunner(verbosity=2).run(tests)
github CleanCut / green / green / suite.py View on Github external
def __init__(self, tests=(), args=None):
        # You should either set GreenTestSuite.args before instantiation, or
        # pass args into __init__
        self._removed_tests = 0
        self.allow_stdout = default_args.allow_stdout
        self.full_test_pattern = 'test' + default_args.test_pattern
        self.customize(args)
        super(GreenTestSuite, self).__init__(tests)
github laike9m / ezcf / setup.py View on Github external
def run_tests(self):
        import sys
        import unittest

        setup_file = sys.modules["__main__"].__file__
        setup_dir = os.path.abspath(os.path.dirname(setup_file))
        tests = unittest.TestLoader().discover(
            os.path.join(setup_dir, "tests"), pattern="*.py"
        )
        try:
            # https://github.com/CleanCut/green/issues/50
            from green.runner import run
            from green.suite import GreenTestSuite
            from green.config import default_args

            default_args.verbose = 3
            run(GreenTestSuite(tests), sys.stdout, default_args)
        except ImportError:
            unittest.TextTestRunner(verbosity=2).run(tests)
github CleanCut / green / green / suite.py View on Github external
def __init__(self, tests=(), args=None):
        # You should either set GreenTestSuite.args before instantiation, or
        # pass args into __init__
        self._removed_tests = 0
        self.allow_stdout = default_args.allow_stdout
        self.full_test_pattern = 'test' + default_args.test_pattern
        self.customize(args)
        super(GreenTestSuite, self).__init__(tests)