Skip to content

Commit

Permalink
Merge pull request #212 from IlyaSkriblovsky/mongodb-3.4-tests-fixed
Browse files Browse the repository at this point in the history
Tests fixed for MongoDB 3.4
  • Loading branch information
psi29a committed Aug 11, 2017
2 parents 4856f77 + 0612471 commit b1191c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions tests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,6 @@ def test_HardLimit(self):
res = yield self.coll.find(limit=-150)
self.assertEqual(len(res), 150)

@defer.inlineCallbacks
def test_HardLimitAboveMessageSizeThreshold(self):
yield self.coll.insert([{'v': ' '*(2**20)} for _ in range(8)], safe=True)
res = yield self.coll.find(limit=-6)
self.assertEqual(len(res), 4)


class TestSkip(SingleCollectionTest):

Expand Down Expand Up @@ -381,8 +375,13 @@ def test_CheckResult(self):
result = yield self.db.command("delete", "mycol", check=False)
self.assertFalse(result["ok"])

result = yield self.db.command("delete", "mycol", check=True,
allowable_errors=["missing deletes field"])
result = yield self.db.command(
"delete", "mycol", check=True,
allowable_errors=[
"missing deletes field",
"The deletes option is required to the delete command."
]
)
self.assertFalse(result["ok"])


Expand Down
2 changes: 1 addition & 1 deletion txmongo/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def create_index(self, sort_fields, **kwargs):
.addCallback(lambda _: name)

@timeout
def ensure_index(self, sort_fields, **kwargs):
def ensure_index(self, sort_fields, _deadline=None, **kwargs):
# ensure_index is an alias of create_index since we are not
# keeping an index cache same way pymongo does
return self.create_index(sort_fields, **kwargs)
Expand Down

0 comments on commit b1191c7

Please sign in to comment.