
from uuid import uuid4 as uuid

import pytest
pymongo = pytest.importorskip('pymongo')

from simplekv.db.mongo import MongoStore
from basic_store import BasicStore


class TestMongoDB(BasicStore):
    @pytest.fixture
    def db_name(self):
        return '_simplekv_test_{}'.format(uuid())

    @pytest.yield_fixture
    def store(self, db_name):
        conn = pymongo.MongoClient()
        yield MongoStore(conn[db_name])
        conn.drop_database(self.db_name)


from uuid import uuid4 as uuid

import pytest
pymongo = pytest.importorskip('pymongo')

from simplekv.db.mongo import MongoStore
from basic_store import BasicStore


class TestMongoDB(BasicStore):
    @pytest.fixture
    def db_name(self):
        return '_simplekv_test_{}'.format(uuid())

    @pytest.yield_fixture
    def store(self, db_name):
        conn = pymongo.MongoClient()
        yield MongoStore(conn[db_name], 'simplekv-tests')
        conn.drop_database(self.db_name)

Add database table name to MongoStore tests.
Add database table name to MongoStore tests.

  
  from uuid import uuid4 as uuid
  
  import pytest
  pymongo = pytest.importorskip('pymongo')
  
  from simplekv.db.mongo import MongoStore
  from basic_store import BasicStore
  
  
  class TestMongoDB(BasicStore):
      @pytest.fixture
      def db_name(self):
          return '_simplekv_test_{}'.format(uuid())
  
      @pytest.yield_fixture
      def store(self, db_name):
          conn = pymongo.MongoClient()
-         yield MongoStore(conn[db_name])
+         yield MongoStore(conn[db_name], 'simplekv-tests')
          conn.drop_database(self.db_name)
  
Add database table name to MongoStore tests.
## Code Before:

from uuid import uuid4 as uuid

import pytest
pymongo = pytest.importorskip('pymongo')

from simplekv.db.mongo import MongoStore
from basic_store import BasicStore


class TestMongoDB(BasicStore):
    @pytest.fixture
    def db_name(self):
        return '_simplekv_test_{}'.format(uuid())

    @pytest.yield_fixture
    def store(self, db_name):
        conn = pymongo.MongoClient()
        yield MongoStore(conn[db_name])
        conn.drop_database(self.db_name)

## Instruction:
Add database table name to MongoStore tests.
## Code After:

from uuid import uuid4 as uuid

import pytest
pymongo = pytest.importorskip('pymongo')

from simplekv.db.mongo import MongoStore
from basic_store import BasicStore


class TestMongoDB(BasicStore):
    @pytest.fixture
    def db_name(self):
        return '_simplekv_test_{}'.format(uuid())

    @pytest.yield_fixture
    def store(self, db_name):
        conn = pymongo.MongoClient()
        yield MongoStore(conn[db_name], 'simplekv-tests')
        conn.drop_database(self.db_name)
