4

Is there a library that supports embedded mongodb for python?

There is a version that I used in Java Embedded MongoDB when running integration tests. Now I moved onto python for another project that uses MongoDB. In my tests, I would like to start a embedded mongodb instance and run tests against this instance. Are there any such libraries in python for MongoDB?

I do not want to mock the response of DB calls, as it would be too much test code to write and too many calls would need to be mocked. So this would be my last option if I have to.

Community
  • 1
  • 1
suman j
  • 6,710
  • 11
  • 58
  • 109

1 Answers1

4

Yes, there is.

Mongomock is small library for mocking pymongo collection objects for testing purposes.

Omid Raha
  • 9,862
  • 1
  • 60
  • 64