-
Notifications
You must be signed in to change notification settings - Fork 290
[Python] [tests] Clear kernel registries in test set up #3432
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
base: main
Are you sure you want to change the base?
Conversation
WIP: Issue#1954 Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
b3e2fb9
to
c1c8978
Compare
…UCCSD module that bypasses kernel registry dependencies, so as to ensure reliable test execution. Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
@pytest.fixture(autouse=True) | ||
def setup_test_environment(): | ||
cudaq.__clearKernelRegistries() | ||
yield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here after the yield, we will need to clean up the kernel registries, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments. Thanks @khalatepradnya for fixing these tests.
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
be found,. In this case, we cannot proceed with testing. Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
c931568
to
ad053e2
Compare
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
This PR refactors test environment setup across multiple Python test files. The setup fixtures now ensure that kernel registries are cleared before tests run, which improves test isolation and reliability.
do_something
fixtures with a unifiedsetup_test_environment
fixture for consistent test initialization and teardown.uccsd
tests: No change if running stand-alone, patch module if kernel registries cleared prior to running. (See issue [Python] [tests] Chemistry tests rely on prebuilt kernels #1954 )