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

assertRaisesRegexp -> assertRaisesRegex #2273

Closed
peterjc opened this issue Sep 18, 2019 · 15 comments
Closed

assertRaisesRegexp -> assertRaisesRegex #2273

peterjc opened this issue Sep 18, 2019 · 15 comments
Labels
good first issue This should be an easy fix, suitable for beginners help wanted Style Testing

Comments

@peterjc
Copy link
Member

peterjc commented Sep 18, 2019

The legacy unittest class method assertRaisesRegexp was deprecated in Python 3 in favour of assertRaisesRegex (no trailing p).

https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaisesRegex

However, Python 2.7 only has assertRaisesRegexp

https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertRaisesRegexp

So, once we drop Python 2.7 support in early 2020, we can convert all the trailing p cases.

@peterjc peterjc added Testing Style good first issue This should be an easy fix, suitable for beginners help wanted labels Sep 18, 2019
@jimmytwright1

This comment has been minimized.

@7291521417

This comment has been minimized.

@dimucciojonathan
Copy link

Right here!

@peterjc
Copy link
Member Author

peterjc commented Sep 30, 2019

I've just hidden a couple of apparently spam comments from accounts created in the last 24 hours (there was other spam/bot activity over the same time period).

@dimucciojonathan Was your comment in reply to one of those?

@dimucciojonathan
Copy link

dimucciojonathan commented Sep 30, 2019 via email

@peterjc
Copy link
Member Author

peterjc commented Sep 30, 2019

@dimucciojonathan Great. Anything with the "good first issue" tag would be worth a look. This particular issue will have to wait until early 2020 once we've done our final release with Python 2.7 support.

@dimucciojonathan
Copy link

dimucciojonathan commented Sep 30, 2019 via email

@joshuacook487
Copy link

Did this end up getting solved? If not I'd be more than happy to take it on?

@dimucciojonathan
Copy link

dimucciojonathan commented Oct 13, 2019 via email

@joshuacook487
Copy link

Sweet, I'll get to it.

@peterjc
Copy link
Member Author

peterjc commented Oct 14, 2019

It can't be be solved until next year because in the short/medium term we still support Python 2.7, which does not have assertRaisesRegex. Perhaps I didn't word this issue clearly enough?

@joshuacook487
Copy link

joshuacook487 commented Oct 14, 2019 via email

@peterjc
Copy link
Member Author

peterjc commented Oct 14, 2019

Well, you could make a branch with the changes now - and while there could be no merge conflicts when we come to use it, the chances are it will need manual updating. I'd recommend leaving this issue for now.

@peterjc
Copy link
Member Author

peterjc commented Dec 25, 2019

It is nearly 2020, and we have now dropped Python 2 support on the master branch - @joshuacooked if you would like to tackle this now, please go ahead. I appreciate it is holiday season, so no rush.

@mdehoon
Copy link
Contributor

mdehoon commented Apr 1, 2020

Fixed by #2574

@mdehoon mdehoon closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This should be an easy fix, suitable for beginners help wanted Style Testing
Projects
None yet
Development

No branches or pull requests

6 participants