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

OrderedDict replaced by custom dict subclass for the sake of py26 #87

Merged
merged 2 commits into from May 13, 2015

Conversation

IlyaSkriblovsky
Copy link
Contributor

Python 2.6 doesn't have OrderedDict, so I replaced it with custom one-line dict subclass for testing as_class parameter of find()

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

Let's see what travis says. :)

It is a pity that we can't use OrderedDict, should we think about making an compat.py for these kinds of things? Or for this case, it isn't even necessary?

@IlyaSkriblovsky
Copy link
Contributor Author

We don't need OrderedDict in txmongo, it was used only for testing if find(as_class=...) works correctly.

Travis complaints, but not on OrderedDict anymore, so this PR might be accepted

@IlyaSkriblovsky
Copy link
Contributor Author

Ouch, I've noticed in Travis that test_Cursor* tests are failing when parsing response of serverStatus MongoDB command. What version of MongoDB is used by Travis?

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

According to this: travis-ci/travis-ci#2246
they are using 2.4, which we don't support. We should only be targeting 2.6 and 3.0 .

I'll whip something up.

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

MongoDB version
MongoDB 2.4.12

Right, then I'll disable travis's mongodb and install 3.0 since that is what we are targetting. It will be nice to test 2.6, but I want the forward momentum. What do you think?

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

I would go with 3.0.3 but it seems that the repo doesn't have it yet:
http://downloads-distro.mongodb.org/repo/ubuntu-upstart/dists/dist/10gen/binary-amd64/

Are we good with 2.6.9 ?

@IlyaSkriblovsky
Copy link
Contributor Author

Sure, but we won't test SCRAM-SHA-1 on 2.6.x. But with 3.0 we won't test MONGODB-CR :)
I think it is better to test on 2.6 since it is most commonly used.

Btw, I've pushed #89 that fixes serverStatus on MongoDB 2.4, it should be ok now

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

Can you rebase against master and force push? That should trigger travis again, hopefully we're green. :)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.38% when pulling 127bd84 on IlyaSkriblovsky:fix-py26 into b69cd11 on twisted:master.

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

Awesome, we finally got some greens and coveralls support! :) 74% isn't bad, but we should aim for 80%

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

[ERROR]
Traceback (most recent call last):
File "/home/travis/build/twisted/txmongo/.tox/py26-tw130/lib/python2.6/site-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
result = g.send(result)
File "/home/travis/build/twisted/txmongo/tests/test_queries.py", line 213, in test_AsClass
self.assertIs(type(doc), dict)
exceptions.AttributeError: 'TestMongoQueries' object has no attribute 'assertIs'
tests.test_queries.TestMongoQueries.test_AsClass

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

Can we replace the self.assertIs with self.assertTrue ?

@IlyaSkriblovsky
Copy link
Contributor Author

Yep, please see b142fa1 that i've pushed just now

@psi29a
Copy link
Contributor

psi29a commented May 13, 2015

beautiful, we're almost there :)
thanks for working with me on this.

@IlyaSkriblovsky
Copy link
Contributor Author

Thanks for the infrastructure support you've implemented! It would help a lot to keep code testable and bulletproof

psi29a added a commit that referenced this pull request May 13, 2015
OrderedDict replaced by custom dict subclass for the sake of py26
@psi29a psi29a merged commit a7c9f18 into twisted:master May 13, 2015
@IlyaSkriblovsky IlyaSkriblovsky deleted the fix-py26 branch May 13, 2015 11:44
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

3 participants