-
Notifications
You must be signed in to change notification settings - Fork 135
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
fallback to unittest when unittest2 is not available #340
Conversation
…t neccessary in python3
@pgajdos Well, the question remains: why is it needed for Python 2.7? (it would be nice to mention it in changelog/spec file)? Is it really needed? |
I think it is lost time to deal with it more as 2.7 is eol. |
import six
six.assertRegex(self, result['custom'], "<class '.*CustomRepr'>")
Not for SLE (although |
Unfortunately, that does not work for me so.
I do not discuss downstream matters in upstream issues. (I do not see the issue with above patch in SLE, though, perhaps bit of reasoning would help me understand the problem.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rollbar/test/__init__.py
Outdated
@@ -1,9 +1,12 @@ | |||
import unittest2 | |||
try: | |||
import unittest2 as unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your change. I don't think we even need to fallback on unittest2 as Python 2+ has been EOLed. Just move ahead with replacing it to unittest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it doesn’t save me. We have rollbar
in Leap 15.* so we still build python2- packages. I don’t want to knowingly break python2 compatibility if I can help it. Do you know rollbar
functionality available only in Python 3.* or unittest2 respectively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcepl, Thank you for your feedback. We are definitely not removing the support for python2 yet. If we can replace unittest2 with unittest without breaking existing tests and builds that will be great.
Done. |
@@ -2,16 +2,6 @@ sudo: false | |||
language: python | |||
matrix: | |||
include: | |||
- python: "2.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not removing support for Python2+ yet so please revert this part. May I know your motivation behind supporting unittest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pgajdos ???
rollbar/test/__init__.py
Outdated
@@ -1,9 +1,12 @@ | |||
import unittest2 | |||
try: | |||
import unittest2 as unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcepl, Thank you for your feedback. We are definitely not removing the support for python2 yet. If we can replace unittest2 with unittest without breaking existing tests and builds that will be great.
https://build.opensuse.org/request/show/821667 by user mcepl + dimstar_suse - Upstream doesn't care about unittest2 at all (gh#rollbar/pyrollbar#340), we can just ignore it. Adjust python-rollbar-no-unittest2.patch accordingly.
I still haven’t got a reply to my answer what capabilities of python3/unittest2 is used in the test suite. Do we need unittest2 (with Python 2.7) at all? |
See #340 (comment). |
I am OK removing 'unittest2' but Not OK with removing support for python2 at this time. Alternatively I can merge your original patch of 'fallback to unittest when unittest2 is not available' if you can provide some explanation on what is motivating on this change that will help understand the context. |
I completely agree, see the linked pull request. |
https://build.opensuse.org/request/show/824631 by user mcepl + dimstar_suse - Replace self.assertRegex with six.assertRegex in python-rollbar-no-unittest2.patch to finally unrequire unittest2 (gh#rollbar/pyrollbar#340). - Update the patch according to the pending pull request gh#rollbar/pyrollbar#346.
unittest2 is not neccessary in python3