From 746a9215d3d02d7d7f6c253469721befc1913e7b Mon Sep 17 00:00:00 2001 From: Robin Pedersen Date: Thu, 10 Dec 2015 14:07:31 +0100 Subject: [PATCH] Make imports work when 'tests' is not python package --- tests/test_config.py | 6 +++--- tests/test_url_converter.py | 4 ++-- tests/test_wrappers.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index f5eaa72..1e3fdc1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,4 +1,4 @@ -from tests import util +from util import FlaskRequestTest, FlaskPyMongoTest import time @@ -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('/') @@ -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): diff --git a/tests/test_url_converter.py b/tests/test_url_converter.py index 5ee7c6b..f3b4719 100644 --- a/tests/test_url_converter.py +++ b/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("/") diff --git a/tests/test_wrappers.py b/tests/test_wrappers.py index c60c8d9..fea6f44 100644 --- a/tests/test_wrappers.py +++ b/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()