# 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



import copy
import functools
import pprint
import traceback
from django.conf import settings
from django_performance_testing import context
from django_performance_testing.signals import results_collected

@functools.total_ordering
class NameValueResult(object):
    def __init__(self, name, value):
        self.name = name
        self.value = value

    def _to_cmp_val(self, other):
        if type(other) == type(self):
            return other.value
        try:
            # other is numeric
            # need it e.g.: to support _pytest.python.ApproxNonIterable
            x = bool(self.value == other)  # noqa: F841
            return other
        except TypeError:
            raise NotImplementedError()

    def __lt__(self, other):
        return self.value < self._to_cmp_val(other)

    def __eq__(self, other):
        return self.value == self._to_cmp_val(other)

    def __str__(self):
        return str(self.value)


class LimitViolationError(RuntimeError):


# 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: django_performance_testing/core.py
import copy
import functools
import pprint
import traceback
from django.conf import settings
from django_performance_testing import context
from django_performance_testing.signals import results_collected


@functools.total_ordering
class NameValueResult(object):
    def __init__(self, name, value):
        self.name = name
        self.value = value

    def _to_cmp_val(self, other):
        if type(other) == type(self):
            return other.value
        try:
            # other is numeric
            # need it e.g.: to support _pytest.python.ApproxNonIterable
            x = bool(self.value == other)  # noqa: F841
            return other
        except TypeError:
            raise NotImplementedError()

    def __lt__(self, other):
        return self.value < self._to_cmp_val(other)

    def __eq__(self, other):
        return self.value == self._to_cmp_val(other)

    def __str__(self):
        return str(self.value)


class LimitViolationError(RuntimeError):


    def __init__(self, limit_obj, result, context, tb=None):