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

Fixing Python 2.6 unit testing and fixing Google tests. #648

Closed
wants to merge 1 commit into from
Closed

Fixing Python 2.6 unit testing and fixing Google tests. #648

wants to merge 1 commit into from

Conversation

crunk1
Copy link
Contributor

@crunk1 crunk1 commented Dec 2, 2015

@jimbobhickville
Copy link
Contributor

jimbobhickville commented Dec 2, 2015

+1 - looks like you covered everything I found and then some.

@jimbobhickville
Copy link
Contributor

jimbobhickville commented Dec 2, 2015

Btw, this should fix https://issues.apache.org/jira/browse/LIBCLOUD-776 - I forget the exact syntax you put in the commit message to have it automatically close the ticket, but I believe there's a way to do that.

@tonybaloney
Copy link
Contributor

tonybaloney commented Dec 2, 2015

👍 looks much cleaner

@crunk1
Copy link
Contributor Author

crunk1 commented Dec 2, 2015

Sorry, still working on it. I have been able to repro it on python2.6. Still fixing atm.

@crunk1
Copy link
Contributor Author

crunk1 commented Dec 2, 2015

It appears that unittest in python 2.6 does not have setUpClass...

@crunk1
Copy link
Contributor Author

crunk1 commented Dec 2, 2015

Interesting... libcloud/testing/init.py:27 shows that they try to mitigate that problem with python 2.6's unittest module by importing unittest2 (which is 2.7's module). But that seems to not be working.

@Kami comment?

@crunk1
Copy link
Contributor Author

crunk1 commented Dec 2, 2015

Could be setup.py:21. It looks like the TestRunner is getting imported from Python 2.6's unittest module, which would explain why setUpClass isn't being called.

@crunk1
Copy link
Contributor Author

crunk1 commented Dec 2, 2015

@Kami please take a look at my change to setup.py.

…est runner instead of a 2.7 test runner. Using a conditional import in setup.py, tests are now run with the standard 2.7 unittest library (known as unittest2 to Python 2.6).

Modified/cleaned up Google tests. Tests were not hermetic, but now proper mocking has been put in place to make them hermetic.

Tests:
python2.7 setup.py test
python2.6 setup.py test
@crunk1 crunk1 changed the title Modified/cleaned up Google tests. Tests were not hermetic, but now pr… Fixing Python 2.6 unit testing and fixing Google tests. Dec 2, 2015
@Kami
Copy link
Member

Kami commented Dec 2, 2015

@crunk1 setup.py change looks good to me - good catch!

@erjohnso
Copy link
Member

erjohnso commented Dec 2, 2015

👍 LGTM too, thanks @crunk1 and @jimbobhickville

I ran through tests on both Mac and my GCE debian instance and it all checks out. Merging it in now.

@asfgit asfgit closed this in 7e087d6 Dec 2, 2015
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.

None yet

5 participants