Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
add test code for postgresql but not enabled, psycopg2 is not esay to…
Browse files Browse the repository at this point in the history
… install
  • Loading branch information
binux committed Mar 4, 2015
1 parent 3d0fd55 commit ddfe678
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]: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://[email protected]: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://[email protected]:5432/pyspider_test_resultdb'
#)

#@classmethod
#def tearDownClass(self):
#self.resultdb._execute('DROP DATABASE pyspider_test_resultdb')


if __name__ == '__main__':
unittest.main()

0 comments on commit ddfe678

Please sign in to comment.