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

No DeprecationWarning deduping during testing #4239

Merged
merged 15 commits into from Jun 25, 2021

Conversation

balopat
Copy link
Contributor

@balopat balopat commented Jun 21, 2021

Disable deprecation warning deduping during testing and fix deprecation assertion logic in json serialization tests.

Fixes #4227.

Merge after #4250 (it contains a fix that is merged in here).

…on assertion logic in json serialization tests
@balopat balopat requested review from cduck, vtomole and a team as code owners June 21, 2021 15:38
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jun 21, 2021
@balopat balopat mentioned this pull request Jun 21, 2021
@balopat balopat added the pr/blocked This PR is blocked on another issue label Jun 22, 2021
@balopat
Copy link
Contributor Author

balopat commented Jun 22, 2021

Blocked on #4250.

@balopat
Copy link
Contributor Author

balopat commented Jun 23, 2021

The CI failure is interesting, there is still some weirdness happening (at least locally):

This fails:

check/pytest -k test_sycamore_circuitop_device

These pass:

check/pytest cirq-google -k test_sycamore_circuitop_device
check/pytest cirq-google 

While they should all fail.

@balopat balopat requested a review from wcourtney as a code owner June 23, 2021 21:35
@balopat
Copy link
Contributor Author

balopat commented Jun 23, 2021

The CI failure is interesting, there is still some weirdness happening (at least locally):

This fails:

check/pytest -k test_sycamore_circuitop_device

These pass:

check/pytest cirq-google -k test_sycamore_circuitop_device
check/pytest cirq-google 

While they should all fail.

It seems that conftest.py is required by all modules to turn on CIRQ_TESTING, it doesn't get picked up from cirq automatically. As @maffoo asked about this back in the day, I thought that it is working and that's why we don't have deprecation errors all over the place :(, it turns out the deduping masked the fact that CIRQ_TESTING wasn't set on submodules. I'm setting this up now on all the modules.

@balopat balopat removed the pr/blocked This PR is blocked on another issue label Jun 23, 2021
@balopat
Copy link
Contributor Author

balopat commented Jun 23, 2021

ready for review @tanujkhattar

cirq-core/cirq/_compat.py Outdated Show resolved Hide resolved
cirq-core/cirq/_compat_test.py Outdated Show resolved Hide resolved


def _get_testspecs_for_modules():
modules = []
for m in TESTED_MODULES:
for m in TESTED_MODULES.keys():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use the default iterator instead of calling .keys() on the dictionary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? I'm not using the dictionary part...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Using default iterators, whenever supported, is more generic and avoids an unnecessary function call.

https://google.github.io/styleguide/pyguide.html#28-default-iterators-and-operators

cirq-core/cirq/protocols/json_serialization_test.py Outdated Show resolved Hide resolved
cirq-core/cirq/protocols/json_serialization_test.py Outdated Show resolved Hide resolved
cirq-ionq/cirq_ionq/conftest.py Show resolved Hide resolved
@balopat
Copy link
Contributor Author

balopat commented Jun 25, 2021

ready for re-review @tanujkhattar.

Copy link
Collaborator

@tanujkhattar tanujkhattar left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 25, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 25, 2021
@CirqBot CirqBot merged commit 6d2cd16 into quantumlib:master Jun 25, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 25, 2021
CirqBot pushed a commit that referenced this pull request Jun 30, 2021
Extracts cirq-pasqal as a separate module.

Merge after #4239, a fix for json testing and deprecation warning deduping and #4250, a fix for flnyt / minimal pytest dependencies (it contains them currently)
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Disable deprecation warning deduping during testing and fix deprecation assertion logic in json serialization tests. 

Fixes quantumlib#4227. 

Merge after quantumlib#4250 (it contains a fix that is merged in here).
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Extracts cirq-pasqal as a separate module.

Merge after quantumlib#4239, a fix for json testing and deprecation warning deduping and quantumlib#4250, a fix for flnyt / minimal pytest dependencies (it contains them currently)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deduplication of deprecation warnings hides deprecation test issues with json serialization
3 participants