Open singh2005 opened 7 years ago
Same problem here. My map_reduce code works fine in pymongo, but my tests break because of mongomock.
Same problem here.
same problem here. Don't work.
@singh2005 seems the travis skip the map_reduce tests
I added your example and it seems to have been fixed in master
pytest tests/test__mongomock.py::CollectionMapReduceTest
======================================================================================= test session starts =======================================================================================
platform darwin -- Python 3.5.2, pytest-3.0.5, py-1.4.31, pluggy-0.4.0
rootdir:/mongomock, inifile:
plugins: cov-2.4.0, celery-4.0.2
collected 10 items
tests/test__mongomock.py ..........
==================================================================================== 10 passed in 1.63 seconds ====================================================================================
I'm creating my fake_collection as follows. Then I want to map the primary_key with 'duration'. I want to calculate the median of all 'duration' values so I can not use reduce function (since it can not calculate median). This test fails at the map_reduce call because the mapped_list does not contain 'values' key. This error only occurs when I'm using my fake mongomock database. This error does not occur when I provide my real mongoDB client.