Commits

Takeshi Komiya committed bbf0ef3

Skip some testcases if RDBMSs are not installed

Comments (0)

Files changed (5)

     'nose',
     'mock',
     'pep8>=1.3',
-    'testing.mysqld',
-    'testing.postgresql',
+    'testing.mysqld>=1.2.1',
+    'testing.postgresql>=1.0.1',
 ]
 
 if sys.version_info < (2, 7):

src/schema2rst/tests/test_mysql.py

 
 import io
 import os
-import unittest
 import tempfile
 import sqlalchemy
 import testing.mysqld
 
 from schema2rst.commands import graph, rst
 
+import sys
+if sys.version_info < (2, 7):
+    import unittest2 as unittest
+else:
+    import unittest
 
+
+@testing.mysqld.skipIfNotInstalled
 class TestSchema2rst(unittest.TestCase):
     def setUp(self):
         self.maxDiff = 65535

src/schema2rst/tests/test_pgsql.py

 
 import io
 import os
-import unittest
 import tempfile
 import sqlalchemy
 import testing.postgresql
 
 from schema2rst.commands import graph, rst
 
+import sys
+if sys.version_info < (2, 7):
+    import unittest2 as unittest
+else:
+    import unittest
 
+
+@testing.postgresql.skipIfNotInstalled
 class TestSchema2rst(unittest.TestCase):
     def setUp(self):
         self.maxDiff = 65535

src/schema2rst/tests/test_schemadump.py

 
 import io
 import os
-import unittest
 import tempfile
 import sqlalchemy
 import testing.mysqld
 
 from schema2rst.commands import dump
 
+import sys
+if sys.version_info < (2, 7):
+    import unittest2 as unittest
+else:
+    import unittest
 
+
+@testing.mysqld.skipIfNotInstalled
 class TestSchemadump(unittest.TestCase):
     def setUp(self):
         self.maxDiff = 65535
     nose
     mock
     flake8
-    testing.mysqld
-    testing.postgresql
+    testing.mysqld >= 1.2.1
+    testing.postgresql >= 1.0.1
 commands=
     nosetests
     flake8 src
     mock
     flake8
     unittest2
-    testing.mysqld
-    testing.postgresql
+    testing.mysqld >= 1.2.1
+    testing.postgresql >= 1.0.1