Skip to content

Commit

Permalink
Tests passing on Python 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Sep 19, 2013
1 parent 4479c56 commit c8588b9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions celery/tests/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,16 @@ def __inner(self, *args, **kwargs):
class AppCase(Case):
contained = True

def __new__(cls, *args, **kwargs):
if cls.__dict__.get('setUp'):
raise RuntimeError(CASE_REDEFINES_SETUP.format(name=qualname(cls)))
if cls.__dict__.get('tearDown'):
raise RuntimeError(CASE_REDEFINES_TEARDOWN.format(
name=qualname(cls)),
def __init__(self, *args, **kwargs):
super(AppCase, self).__init__(*args, **kwargs)
if self.__class__.__dict__.get('setUp'):
raise RuntimeError(
CASE_REDEFINES_SETUP.format(name=qualname(self)),
)
if self.__class__.__dict__.get('tearDown'):
raise RuntimeError(
CASE_REDEFINES_TEARDOWN.format(name=qualname(self)),
)
return super(AppCase, cls).__new__(cls, *args, **kwargs)

def Celery(self, *args, **kwargs):
return UnitApp(*args, **kwargs)
Expand Down

0 comments on commit c8588b9

Please sign in to comment.