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

Fix independent test running (#211) #212

Merged
merged 3 commits into from
Dec 20, 2016
Merged

Fix independent test running (#211) #212

merged 3 commits into from
Dec 20, 2016

Conversation

alastair
Copy link
Owner

@alastair alastair commented Dec 2, 2016

Fixes #211
Now tests work when run independently.

I thought about adding a parent testcase class which set client/auth in the setUp and back to empty in tearDown, but I wasn't sure if it was a good idea to do it in all tests even if they didn't use that functionality.
(Also, how do you do super compatible with python2 and python3?)

Signed-off-by: Alastair Porter <alastair@porter.net.nz>
These tests worked when run in the same context as
other tests, but when run independently would fail.
Fixes #211

Signed-off-by: Alastair Porter <alastair@porter.net.nz>
Signed-off-by: Alastair Porter <alastair@porter.net.nz>
@mineo
Copy link
Collaborator

mineo commented Dec 6, 2016

I thought about adding a parent testcase class which set client/auth in the setUp and back to empty in tearDown, but I wasn't sure if it was a good idea to do it in all tests even if they didn't use that functionality.

I don't think this would be a problem for this test suite because it runs in about a second and those operations wouldn't increase that time significantly. You could get all fancy with mixins to only add it to those classes that need it, but I don't think that's worth the trouble.

(Also, how do you do super compatible with python2 and python3?)

super(classname, self).foo() should work in both I think.

LGTM otherwise.

@mineo mineo merged commit e8b6d30 into master Dec 20, 2016
mineo added a commit that referenced this pull request Dec 20, 2016
Fix independent test running (#211)

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
@mineo mineo deleted the tests branch January 21, 2017 14:28
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

2 participants