Skip to content

Commit

Permalink
Make imports work when 'tests' is not python package
Browse files Browse the repository at this point in the history
  • Loading branch information
ropez committed Dec 10, 2015
1 parent f94bc8a commit 746a921
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/test_config.py
@@ -1,4 +1,4 @@
from tests import util
from util import FlaskRequestTest, FlaskPyMongoTest

import time

Expand All @@ -12,7 +12,7 @@ class CustomDict(dict):
pass


class FlaskPyMongoConfigTest(util.FlaskRequestTest):
class FlaskPyMongoConfigTest(FlaskRequestTest):
def setUp(self):
self.app = flask.Flask('test')
self.context = self.app.test_request_context('/')
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_uri_without_database_errors_sensibly(self):
self.assertRaises(ValueError, flask.ext.pymongo.PyMongo, self.app)


class CustomDocumentClassTest(util.FlaskPyMongoTest):
class CustomDocumentClassTest(FlaskPyMongoTest):
""" Class that tests reading from DB with custom document_class """

def test_create_with_document_class(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_url_converter.py
@@ -1,10 +1,10 @@
from tests import util
from util import FlaskPyMongoTest
from flask.ext.pymongo import BSONObjectIdConverter

from bson import ObjectId
from werkzeug.exceptions import BadRequest

class UrlConverterTest(util.FlaskPyMongoTest):
class UrlConverterTest(FlaskPyMongoTest):

def test_bson_object_id_converter(self):
converter = BSONObjectIdConverter("/")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_wrappers.py
@@ -1,9 +1,9 @@
from tests import util
from util import FlaskPyMongoTest
from werkzeug.exceptions import HTTPException

import pymongo

class CollectionTest(util.FlaskPyMongoTest):
class CollectionTest(FlaskPyMongoTest):

def test_find_one_or_404(self):
self.mongo.db.things.remove()
Expand Down

0 comments on commit 746a921

Please sign in to comment.