Skip to content
Browse files

Move tests out of momoko module.

This makes it possible to run the tests without importing
one of the Psycopg2 implementations first.
  • Loading branch information...
1 parent a13246b commit af1937d5ea3dd22dec733148116fd9088b7fee9e @FSX committed Jan 16, 2013
Showing with 15 additions and 10 deletions.
  1. +1 −8 setup.py
  2. +14 −2 {momoko → }/tests.py
View
9 setup.py
@@ -21,19 +21,12 @@
dependencies = ['tornado']
psycopg2_impl = os.environ.get('MOMOKO_PSYCOPG2_IMPL', 'psycopg2')
-
if psycopg2_impl == 'psycopg2cffi':
print('Using psycopg2cffi')
dependencies.append('psycopg2cffi')
-
- from psycopg2cffi import compat
- compat.register()
elif psycopg2_impl == 'psycopg2ct':
print('Using psycopg2ct')
dependencies.append('psycopg2ct')
-
- from psycopg2ct import compat
- compat.register()
else:
print('Using psycopg2')
dependencies.append('psycopg2')
@@ -49,7 +42,7 @@
url='http://momoko.61924.nl/',
packages=['momoko'],
license='MIT',
- test_suite='momoko.tests',
+ test_suite='tests',
install_requires=dependencies,
classifiers = [
'Development Status :: 4 - Beta',
View
16 momoko/tests.py → tests.py
@@ -3,8 +3,6 @@
import random
import unittest
-import momoko
-import psycopg2
from tornado import gen
from tornado.testing import AsyncTestCase
@@ -24,6 +22,20 @@
'MOMOKO_TEST_HOST, MOMOKO_TEST_PORT')
+psycopg2_impl = os.environ.get('MOMOKO_PSYCOPG2_IMPL', 'psycopg2')
+
+if psycopg2_impl == 'psycopg2cffi':
+ from psycopg2cffi import compat
+ compat.register()
+elif psycopg2_impl == 'psycopg2ct':
+ from psycopg2ct import compat
+ compat.register()
+
+
+import momoko
+import psycopg2
+
+
class BaseTest(AsyncTestCase):
def __init__(self, *args, **kwargs):
self.assert_equal = self.assertEqual

0 comments on commit af1937d

Please sign in to comment.
Something went wrong with that request. Please try again.