`qiskit.test.decorators.enforce_subclasses_call` machinery is broken in 3.11.1
See original GitHub issueEnvironment
- Qiskit Terra version:
HEAD of main, currently dd7f9390cf07
- Python version:
3.11.1
- Operating system:
Both macOS and ubuntu, so far.
What is happening?
import test.python
raises an error in 3.11.1, therefore tests do not run. @wshanks has indicated that it is working fine for him in 3.11.0 but not 3.11.1 (I don’t have 3.11.0 installed).
Python 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ihincks/ibm/qiskit-terra/test/__init__.py", line 16, in <module>
from qiskit.test.utils import generate_cases
File "/Users/ihincks/ibm/qiskit-terra/qiskit/test/__init__.py", line 15, in <module>
from .base import QiskitTestCase
File "/Users/ihincks/ibm/qiskit-terra/qiskit/test/base.py", line 167, in <module>
class QiskitTestCase(BaseQiskitTestCase):
File "/Users/ihincks/ibm/qiskit-terra/qiskit/utils/classtools.py", line 117, in out
retval = method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TestCase.__init_subclass__() missing 1 required positional argument: 'cls'
Or, see an example of this happening in CI: https://github.com/Qiskit/qiskit-experiments/actions/runs/3704009805/jobs/6281449337
How can we reproduce the issue?
Run the tests or simply import test.python
in Python 3.11.1.
What should happen?
This should not error.
Any suggestions?
No response
Issue Analytics
- State:
- Created 9 months ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
unittest — Unit testing framework — Python 3.11.1 ...
It has been broken since Python 3.7. ... Skipping a test is simply a matter of using the skip() decorator or one of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ihincks When I see a message about
_accelerate
, it is usually because I forgot to runpip install .
after switching branches or Python versions (because it is the first compiled thing that is imported).please, revert https://github.com/Qiskit/qiskit-terra/pull/9296 when fixed.