diff --git a/.travis.yml b/.travis.yml index 76cee30be..dc2287878 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ python: services: - mongodb - rabbitmq +#addons: + #postgresql: "9.4" install: - pip install --allow-all-external -r requirements.txt - pip install coveralls httpbin pyproxy>=0.1.6 diff --git a/tests/test_database.py b/tests/test_database.py index 2198196d0..42c0fdc5c 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -480,5 +480,49 @@ def setUpClass(self): def tearDownClass(self): del self.resultdb + +#@unittest.skipIf(os.environ.get('IGNORE_POSTGRESQL'), 'no postgresql server for test.') +#class TestPGTaskDB(TaskDBCase, unittest.TestCase): + + #@classmethod + #def setUpClass(self): + #self.taskdb = database.connect_database( + #'sqlalchemy+postgresql+taskdb://postgres@127.0.0.1:5432/pyspider_test_taskdb' + #) + + #@classmethod + #def tearDownClass(self): + #self.taskdb._execute('DROP DATABASE pyspider_test_taskdb') + + +#@unittest.skipIf(os.environ.get('IGNORE_POSTGRESQL'), 'no postgresql server for test.') +#class TestPGProjectDB(ProjectDBCase, unittest.TestCase): + + + #@classmethod + #def setUpClass(self): + #self.projectdb = database.connect_database( + #'sqlalchemy+postgresql+taskdb://postgres@127.0.0.1:5432/pyspider_test_projectdb' + #) + + #@classmethod + #def tearDownClass(self): + #self.projectdb._execute('DROP DATABASE pyspider_test_projectdb') + + +#@unittest.skipIf(os.environ.get('IGNORE_POSTGRESQL'), 'no postgresql server for test.') +#class TestPGResultDB(ResultDBCase, unittest.TestCase): + + #@classmethod + #def setUpClass(self): + #self.resultdb = database.connect_database( + #'sqlalchemy+postgresql+taskdb://postgres@127.0.0.1:5432/pyspider_test_resultdb' + #) + + #@classmethod + #def tearDownClass(self): + #self.resultdb._execute('DROP DATABASE pyspider_test_resultdb') + + if __name__ == '__main__': unittest.main()