Python django.test.utils 模块,teardown_test_environment() 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用django.test.utils.teardown_test_environment()

项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def run_tests(self, test_labels, extra_tests=None, **kwargs):
        """
        Run the unit tests for all the test labels in the provided list.

        Test labels should be dotted Python paths to test modules, test
        classes, or test methods.

        A list of 'extra' tests may also be provided; these tests
        will be added to the test suite.

        Returns the number of tests that failed.
        """
        self.setup_test_environment()
        suite = self.build_suite(test_labels, extra_tests)
        old_config = self.setup_databases()
        result = self.run_suite(suite)
        self.teardown_databases(old_config)
        self.teardown_test_environment()
        return self.suite_result(suite, result)
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def run_tests(self, test_labels, extra_tests=None, **kwargs):
        """
        Run the unit tests for all the test labels in the provided list.

        Test labels should be dotted Python paths to test modules, test
        classes, or test methods.

        A list of 'extra' tests may also be provided; these tests
        will be added to the test suite.

        Returns the number of tests that failed.
        """
        self.setup_test_environment()
        suite = self.build_suite(test_labels, extra_tests)
        old_config = self.setup_databases()
        result = self.run_suite(suite)
        self.teardown_databases(old_config)
        self.teardown_test_environment()
        return self.suite_result(suite, result)
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def run_tests(self, test_labels, extra_tests=None, **kwargs):
        """
        Run the unit tests for all the test labels in the provided list.

        Test labels should be dotted Python paths to test modules, test
        classes, or test methods.

        A list of 'extra' tests may also be provided; these tests
        will be added to the test suite.

        Returns the number of tests that failed.
        """
        self.setup_test_environment()
        suite = self.build_suite(test_labels, extra_tests)
        old_config = self.setup_databases()
        result = self.run_suite(suite)
        self.teardown_databases(old_config)
        self.teardown_test_environment()
        return self.suite_result(suite, result)
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def run_tests(self, test_labels, extra_tests=None, **kwargs):
        """
        Run the unit tests for all the test labels in the provided list.

        Test labels should be dotted Python paths to test modules, test
        classes, or test methods.

        A list of 'extra' tests may also be provided; these tests
        will be added to the test suite.

        Returns the number of tests that failed.
        """
        self.setup_test_environment()
        suite = self.build_suite(test_labels, extra_tests)
        old_config = self.setup_databases()
        result = self.run_suite(suite)
        self.teardown_databases(old_config)
        self.teardown_test_environment()
        return self.suite_result(suite, result)
项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment()
项目:deb-python-semantic-version    作者:openstack    | 项目源码 | 文件源码
def tearDownModule():
    if not django_loaded:  # pragma: no cover
        return
    runner = test_state['runner']
    runner_state = test_state['runner_state']
    runner.teardown_databases(runner_state)
    django_test_utils.teardown_test_environment()


# the refresh_from_db method only came in with 1.8, so in order to make this
# work will all supported versions we have our own function.
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment()
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment()
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def teardown_test_environment(self, **kwargs):
        unittest.removeHandler()
        teardown_test_environment()