Switch to exam test runner instead of our fixture implementation

This commit is contained in:
David Cramer 2012-12-26 13:29:47 -08:00
parent 3bc464183b
commit 3ee500c7d5
4 changed files with 4 additions and 36 deletions

View File

@ -1,33 +0,0 @@
"""
raven.utils.tests
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
NOTSET = object()
class fixture(object):
"""
>>> class Foo(object):
>>> @fixture
>>> def foo(self):
>>> # calculate something important here
>>> return 42
"""
def __init__(self, func):
self.__name__ = func.__name__
self.__module__ = func.__module__
self.__doc__ = func.__doc__
self.func = func
def __get__(self, obj, type=None):
if obj is None:
return self
value = obj.__dict__.get(self.__name__, NOTSET)
if value is NOTSET:
value = self.func(obj)
obj.__dict__[self.__name__] = value
return value

View File

@ -2,6 +2,7 @@ blinker>=1.1
celery>=2.5
Django>=1.2,<1.5
django-celery>=2.5
exam>=0.5.2
Flask>=0.8
logbook
mock

View File

@ -1,9 +1,9 @@
import mock
import sys
from exam import fixture
from unittest2 import TestCase
from raven.context import Context
from raven.utils.tests import fixture
class ContextTest(TestCase):

View File

@ -2,11 +2,11 @@ from __future__ import with_statement
import logging
import webob
from exam import fixture
from unittest2 import TestCase
from raven.base import Client
from raven.middleware import Sentry
from raven.utils.tests import fixture
class TempStoreClient(Client):