New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with setUpClass #280

Closed
MikeVL opened this Issue Oct 6, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@MikeVL

MikeVL commented Oct 6, 2015

My test code is:

class MarketFixtures(object):
    fixtures = [
        'tests/fixtures/common_rubricator.json',
    ]

class MarketOfferPictureTestCase(MarketFixtures, TestCase):
    ...

Raised with error

/usr/local/lib/python2.7/dist-packages/pytest_django/plugin.py:301: in pytest_runtest_setup
    _disable_class_methods(cls)
/usr/local/lib/python2.7/dist-packages/pytest_django/plugin.py:266: in _disable_class_methods
    _method_is_defined_at_leaf(cls, 'setUpClass'),
/usr/local/lib/python2.7/dist-packages/pytest_django/plugin.py:254: in _method_is_defined_at_leaf
    return getattr(cls.__base__, method_name).__func__ is not getattr(cls, method_name).__func__
E   AttributeError: type object 'MarketFixtures' has no attribute 'setUpClass'
@blueyed

This comment has been minimized.

Contributor

blueyed commented Oct 6, 2015

Also a problem with tests from django-autocomplete-light: https://travis-ci.org/yourlabs/django-autocomplete-light/jobs/83851177

@blueyed blueyed referenced this issue Oct 6, 2015

Closed

Django19fix #501

@pelme

This comment has been minimized.

Member

pelme commented Oct 6, 2015

Seems easy to reproduce, will try to push a fix and 2.9.1 release soon!

pelme added a commit to pelme/pytest-django that referenced this issue Oct 6, 2015

Fix regression introduced in 96f5fb1.
The previous fix did not properly check the full MRO chain when looking
for the super method, which then failed when used with mixins that does
not define setUpClass/tearDownClass.

This commit fixes issue pytest-dev#280.

@pelme pelme referenced this issue Oct 6, 2015

Closed

Fix for #280. #281

pelme added a commit that referenced this issue Oct 6, 2015

Fix regression introduced in 96f5fb1.
The previous fix did not properly check the full MRO chain when looking
for the super method, which then failed when used with mixins that does
not define setUpClass/tearDownClass.

This commit fixes issue #280.
@pelme

This comment has been minimized.

Member

pelme commented Oct 6, 2015

This is now fixed in master, and released in 2.9.1 on PyPI!

@pelme pelme closed this Oct 6, 2015

tomviner added a commit to tomviner/pytest-django that referenced this issue Jun 22, 2016

Fix regression introduced in 96f5fb1.
The previous fix did not properly check the full MRO chain when looking
for the super method, which then failed when used with mixins that does
not define setUpClass/tearDownClass.

This commit fixes issue pytest-dev#280.

mfa added a commit to aexeagmbh/pytest-django that referenced this issue May 17, 2017

Fix regression introduced in 96f5fb1.
The previous fix did not properly check the full MRO chain when looking
for the super method, which then failed when used with mixins that does
not define setUpClass/tearDownClass.

This commit fixes issue pytest-dev#280.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment