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_utilities: Promote deprecations to errors in pydrake unit tests #12874

Merged

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Mar 14, 2020

This used to be the case for python2, but was lost in the transition to python3 due to changes to unittest.main semantics.

The python3 unittest.main added the following new semantics:

        if warnings is None and not sys.warnoptions:
            # even if DeprecationWarnings are ignored by default
            # print them anyway unless other warnings settings are
            # specified by the warnings arg or the -W python flag
            self.warnings = 'default'

Because we apply our warning filters prior to calling unittest.main(), the unittest filter for any and all Warning instances trumps our more custom filters.

Towards #12873.


This change is Reviewable

This used to be the case for python2, but was lost in the transition to
python3 due to changes to unittest.main semantics.
@jwnimmer-tri
Copy link
Collaborator Author

jwnimmer-tri commented Mar 14, 2020

+@sammy-tri for feature review, please.

(\CC @EricCousineau-TRI to look at retroactively once you're available.)

@jwnimmer-tri jwnimmer-tri marked this pull request as ready for review March 14, 2020 16:11
@jwnimmer-tri
Copy link
Collaborator Author

Actually, +@EricCousineau-TRI for feature review, please. We can leave @sammy-tri for platform review tomorrow after feature pass is done.

Copy link
Contributor

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

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

:lgtm: - great catch!

Reviewed 2 of 2 files at r1.
Reviewable status: LGTM missing from assignee sammy-tri(platform) (waiting on @sammy-tri)

@jwnimmer-tri
Copy link
Collaborator Author

... and a shout-out to --trace=sys for making this much easier to debug!

Copy link
Contributor

@sammy-tri sammy-tri left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees sammy-tri(platform),EricCousineau-TRI(platform)

@sammy-tri sammy-tri merged commit f3accb7 into RobotLocomotion:master Mar 16, 2020
@jwnimmer-tri jwnimmer-tri deleted the pydrake-warnings-for-realz branch March 19, 2020 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants