# Path: django_performance_testing/context.py
# class Context(object):
# class scoped_context(object):
#     def __init__(self):
#     def enter(self, key, value):
#     def exit(self, key, value):
#     def __init__(self, key, value, context=None):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# 
# Path: django_performance_testing/signals.py



from collections import namedtuple
from django.conf import settings
from django.test.utils import get_runner
from django.utils import six
from django_performance_testing import context
from django_performance_testing.signals import results_collected
            assert not self.all_should_pass, result.output
        else:
            assert self.all_should_pass, result.output
        assert result.testsRun == self.nr_of_tests, result.output
        return result


def run_testcases_with_django_runner(testcases_to_run, nr_of_tests,
                                     all_should_pass=True, print_bad=True,
                                     runner_options=None):
    if isinstance(testcases_to_run, type):
        testcases_to_run = [testcases_to_run]
    package = RunnerTestCasePackage(
        testcases_to_run, nr_of_tests, all_should_pass,
        print_bad, runner_options)
    result = package.run()
    return {
        "result": result,
        "output": result.output,
        "runner": package.test_runner
    }


class capture_result_collected(object):

    def __enter__(self):
        self.calls = []
        results_collected.connect(self.results_collected_handler)
        return self


# Path: django_performance_testing/context.py
# class Context(object):
# class scoped_context(object):
#     def __init__(self):
#     def enter(self, key, value):
#     def exit(self, key, value):
#     def __init__(self, key, value, context=None):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# 
# Path: django_performance_testing/signals.py



# Path: tests/testapp/test_helpers.py
from collections import namedtuple
from django.conf import settings
from django.test.utils import get_runner
from django.utils import six
from django_performance_testing import context
from django_performance_testing.signals import results_collected

            assert not self.all_should_pass, result.output
        else:
            assert self.all_should_pass, result.output
        assert result.testsRun == self.nr_of_tests, result.output
        return result


def run_testcases_with_django_runner(testcases_to_run, nr_of_tests,
                                     all_should_pass=True, print_bad=True,
                                     runner_options=None):
    if isinstance(testcases_to_run, type):
        testcases_to_run = [testcases_to_run]
    package = RunnerTestCasePackage(
        testcases_to_run, nr_of_tests, all_should_pass,
        print_bad, runner_options)
    result = package.run()
    return {
        "result": result,
        "output": result.output,
        "runner": package.test_runner
    }


class capture_result_collected(object):

    def __enter__(self):
        self.calls = []
        results_collected.connect(self.results_collected_handler)
        return self


    def results_collected_handler(self, signal, sender, results, context):