This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Skipping a test mixin gives metaclass error
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, michael.foord, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-04-24 21:34 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
skip_mixin.patch pitrou, 2012-04-24 21:34 review
Messages (8)
msg159213 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-04-24 21:34
Seen on a buildbot:

test test_multiprocessing crashed -- Traceback (most recent call last):
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/regrtest.py", line 1229, in runtest_inner
    the_package = __import__(abstest, globals(), locals(), [])
  File "<frozen importlib._bootstrap>", line 1030, in _find_and_load
  File "<frozen importlib._bootstrap>", line 611, in load_module
  File "<frozen importlib._bootstrap>", line 271, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 499, in _load_module
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_multiprocessing.py", line 2430, in <module>
    testcases_processes = create_test_cases(ProcessesMixin, type='processes')
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_multiprocessing.py", line 2409, in create_test_cases
    class Temp(base, unittest.TestCase, Mixin):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases


Here is a patch.
msg159216 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2012-04-24 21:39
Patch looks good - thanks.
msg159277 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-25 13:00
New changeset ab3df6979bd0 by Antoine Pitrou in branch '3.2':
Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test class that doesn't inherit from TestCase (i.e. a mixin).
http://hg.python.org/cpython/rev/ab3df6979bd0

New changeset 188b96e0ea89 by Antoine Pitrou in branch 'default':
Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test class that doesn't inherit from TestCase (i.e. a mixin).
http://hg.python.org/cpython/rev/188b96e0ea89
msg159278 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-04-25 13:01
Fixed, thanks.
msg159285 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2012-04-25 13:40
This could go into 2.7 too.
msg159300 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-25 15:32
New changeset 8a8d2f05068a by Antoine Pitrou in branch '2.7':
Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test class that doesn't inherit from TestCase (i.e. a mixin).
http://hg.python.org/cpython/rev/8a8d2f05068a
msg159301 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-04-25 15:32
> This could go into 2.7 too.

Done!
msg159303 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2012-04-25 15:39
Thanks Antoine - much appreciated.
History
Date User Action Args
2022-04-11 14:57:29adminsetgithub: 58869
2012-04-25 15:39:57michael.foordsetmessages: + msg159303
2012-04-25 15:32:55pitrousetmessages: + msg159301
versions: + Python 2.7
2012-04-25 15:32:40python-devsetmessages: + msg159300
2012-04-25 13:40:58michael.foordsetmessages: + msg159285
2012-04-25 13:01:57pitrousetstatus: open -> closed
resolution: fixed
messages: + msg159278

stage: patch review -> resolved
2012-04-25 13:00:36python-devsetnosy: + python-dev
messages: + msg159277
2012-04-24 21:39:19michael.foordsetmessages: + msg159216
2012-04-24 21:34:34pitroucreate