question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`qiskit.test.decorators.enforce_subclasses_call` machinery is broken in 3.11.1

See original GitHub issue

Environment

  • 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:open
  • Created 9 months ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
wshankscommented, Dec 20, 2022

@ihincks When I see a message about _accelerate, it is usually because I forgot to run pip install . after switching branches or Python versions (because it is the first compiled thing that is imported).

1reaction
1ucian0commented, Dec 19, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found