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

test: turn PL deprecation warnings into errors #4823

Merged
merged 4 commits into from
Nov 15, 2023
Merged

Conversation

timmysilv
Copy link
Contributor

confirmed locally that it works, and it won't be raised if the warning is caught/suppressed in a test

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c12cbe8) 99.65% compared to head (3558476) 99.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4823      +/-   ##
==========================================
- Coverage   99.65%   99.64%   -0.01%     
==========================================
  Files         381      381              
  Lines       34346    34086     -260     
==========================================
- Hits        34226    33965     -261     
- Misses        120      121       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timmysilv timmysilv requested a review from a team November 10, 2023 17:38
@albi3ro
Copy link
Contributor

albi3ro commented Nov 10, 2023

So I get:

============================================================== short test summary info ===============================================================
ERROR tests/drawer/test_draw.py - pennylane.PennyLaneDeprecationWarning: Decorating a QNode with @transform_fn(**transform_kwargs) has been deprecated and will be removed in a fut...
ERROR tests/transforms/test_batch_transform.py - pennylane.PennyLaneDeprecationWarning: Use of `batch_transform` to create a custom transform is deprecated. Instead switch to using the new qml.t...
ERROR tests/transforms/test_op_transform.py - pennylane.PennyLaneDeprecationWarning: Use of `op_transform` to create a custom transform is deprecated. Instead switch to using the new qml.tran...
ERROR tests/transforms/test_qfunc_transform.py - pennylane.PennyLaneDeprecationWarning: Use of `qfunc_transform` to create a custom transform is deprecated. Instead switch to using the new qml.t...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

which is weird that this happens locally for me but not in the CI.

Especially if you aren't seeing any problems ... 🤷

@timmysilv
Copy link
Contributor Author

timmysilv commented Nov 10, 2023

nice find, turns out I was seeing it locally too! I only tested a particular case locally. The error comes up during test collection, and we don't see it in CI because we specify the -p no:warnings option, which suppresses the early-loading of warnings. I added the option to pytest.ini, so now running tests locally should work fine.

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

I am wondering if we should instead explicitly silence the warnings that occur during collection, but I'm ok with this solution too.

@timmysilv timmysilv requested a review from a team November 14, 2023 17:10
@timmysilv timmysilv enabled auto-merge (squash) November 15, 2023 15:52
@timmysilv timmysilv merged commit aab9ed9 into master Nov 15, 2023
32 checks passed
@timmysilv timmysilv deleted the catch-pl-deprecations branch November 15, 2023 16:24
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