Skip to content

Use assertRaisesRegex instead of assertRaisesRegexp for Python 3.11 compatibility #3426

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

Merged
merged 1 commit into from
May 2, 2022
Merged

Conversation

tirkarthi
Copy link
Contributor

Code PR

The deprecated aliases were removed in Python 3.11 in python/cpython#28268 . So this PR replaces assertRaisesRegexp with assertRaisesRegex for Python 3.11 compatibility.

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the codegen files and not generated files.
  • I have added tests (if submitting a new feature or correcting a bug) or
    modified existing tests.
  • For a new feature, I have added documentation examples in an existing or
    new tutorial notebook (please see the doc checklist as well).
  • I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
  • For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).

Command to identify deprecated aliases :

 rg -t py 'assertEquals|assertNotEquals|assertAlmostEquals|assertNotAlmostEquals|assertRegexpMatches|assertNotRegexpMatches|assertRaisesRegexp|failUnlessEqual|failIfEqual|failUnlessAlmostEqual|failUnless|failUnlessRaises|failIf|assertDictContainsSubset|_TextTestResult' 

@tirkarthi
Copy link
Contributor Author

I am not sure of the docs build error in CI

@nicolaskruchten
Copy link
Contributor

Thanks for this!

@nicolaskruchten nicolaskruchten merged commit a1ef556 into plotly:master May 2, 2022
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.

2 participants