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

Fix test deprecation warnings and call parent's setUpClass #1303

Merged
merged 4 commits into from
Aug 5, 2021

Conversation

mtreinish
Copy link
Member

Summary

In Qiskit/qiskit#6753 the base test classes were fixed to assert
that setUp and setUpClass in the base test class are always called. This
is necessary to ensure that all the warning assertions always work.
However this change had the unintended side effect of causing Aer's CI
to fail because it wasn't calling super().setUpClass(). This commit
makes this change to fix that failure. However, because now we're
running enforcement that tests can't raise unhandled
DeprecationWarnings a few spots in the tests were emitting deprecation
warnings. The deprecated syntax is either fixed or if it's testing
something in Aer that's deprecated an assertion on that warning is added
to fix the failure.

Details and comments

In Qiskit/qiskit#6753 the base test classes were fixed to assert
that setUp and setUpClass in the base test class are always called. This
is necessary to ensure that all the warning assertions always work.
However this change had the unintended side effect of causing Aer's CI
to fail because it wasn't calling super().setUpClass(). This commit
makes this change to fix that failure. However, because now we're
running enforcement that tests can't raise unhandled
DeprecationWarnings a few spots in the tests were emitting deprecation
warnings. The deprecated syntax is either fixed or if it's testing
something in Aer that's deprecated an assertion on that warning is added
to fix the failure.
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should work out the split properly, so Aer doesn't need to derive its test class from Terra-specific functionality, but that's something to work out on the Terra side first.

One question about a test that's dropped out of a loop, though it looks like it still belongs in it?

@jakelishman
Copy link
Member

Oh wait, I have no power on Aer. Still, you can have a symbolic tick, if not a meaningful one.

@chriseclectic chriseclectic merged commit dcff5b2 into Qiskit:main Aug 5, 2021
@mtreinish mtreinish deleted the fix-baseclass-ci branch August 12, 2021 22:35
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

Successfully merging this pull request may close these issues.

3 participants