Skip to content
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

How to run the test cases? #13499

Open
boonware opened this issue Nov 27, 2024 · 0 comments
Open

How to run the test cases? #13499

boonware opened this issue Nov 27, 2024 · 0 comments

Comments

@boonware
Copy link
Contributor

How does one run the tests for this project? I have followed these guidelines, however, I cannot run the tests successfully. Running the following command in the project root directory:

tox -epy310 -- -n test.python.compiler.test_transpiler.TestTranspile

I receive the following error output. Note that the test run also appears to be installing dependencies every time I attempt to run a test.

.pkg: _optional_hooks> python /Users/acme/.venvs/qiskit-dev/lib/python3.13/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /Users/acme/.venvs/qiskit-dev/lib/python3.13/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_wheel> python /Users/acme/.venvs/qiskit-dev/lib/python3.13/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_editable> python /Users/acme/.venvs/qiskit-dev/lib/python3.13/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_wheel> python /Users/acme/.venvs/qiskit-dev/lib/python3.13/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /Users/acme/.venvs/qiskit-dev/lib/python3.13/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py310: install_package> pip install -c/Users/acme/git/public/boonware/qiskit/constraints.txt -U --force-reinstall --no-deps /Users/acme/git/public/boonware/qiskit/.tox/.tmp/package/15/qiskit-2.0.0.tar.gz
py310: commands[0]> stestr run -n test.python.compiler.test_transpiler.TestTranspile
{0} unittest.loader._FailedTest.test [0.000058s] ... FAILED

Captured traceback:

    ImportError: Failed to import test module: test
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/Users/acme/git/public/boonware/qiskit/test/__init__.py", line 18, in <module>
    from .utils.base import QiskitTestCase
  File "/Users/acme/git/public/boonware/qiskit/test/utils/__init__.py", line 15, in <module>
    from .decorators import slow_test
  File "/Users/acme/git/public/boonware/qiskit/test/utils/decorators.py", line 21, in <module>
    from qiskit.utils import wrap_method
  File "/Users/acme/git/public/boonware/qiskit/qiskit/__init__.py", line 47, in <module>
    from . import _accelerate
ImportError: cannot import name '_accelerate' from partially initialized module 'qiskit' (most likely due to a circular import) (/Users/acme/git/public/boonware/qiskit/qiskit/__init__.py)



==============================
Failed 1 tests - output below:
==============================

unittest.loader._FailedTest.test
--------------------------------

Captured traceback:
ImportError: Failed to import test module: test

Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
module = import(module_name)
File "/Users/acme/git/public/boonware/qiskit/test/init.py", line 18, in
from .utils.base import QiskitTestCase
File "/Users/acme/git/public/boonware/qiskit/test/utils/init.py", line 15, in
from .decorators import slow_test
File "/Users/acme/git/public/boonware/qiskit/test/utils/decorators.py", line 21, in
from qiskit.utils import wrap_method
File "/Users/acme/git/public/boonware/qiskit/qiskit/init.py", line 47, in
from . import _accelerate
ImportError: cannot import name '_accelerate' from partially initialized module 'qiskit' (most likely due to a circular import) (/Users/acme/git/public/boonware/qiskit/qiskit/init.py)

======
Totals

Ran: 1 tests in 0.0001 sec.

  • Passed: 0
  • Skipped: 0

No tests were successful during the run

  • Expected Fail: 0
  • Unexpected Success: 0
  • Failed: 1
    Sum of execute time for each test: 0.0001 sec.

==============
Worker Balance

  • Worker 0 (1 tests) => 0:00:00.000058
    py310: exit 1 (0.32 seconds) /Users/acme/git/public/boonware/qiskit> stestr run -n test.python.compiler.test_transpiler.TestTranspile pid=77603
    py310: FAIL code 1 (118.66=setup[118.34]+cmd[0.32] seconds)
    evaluation failed :( (118.72 seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant