Skip to content

Commit c8f7748

Browse files
committed
pg8000 trial
1 parent ccec351 commit c8f7748

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

requirements-py2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
coverage
2+
pg8000
23
psycopg2
34
MySQL-python

requirements-py3.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
coverage
2+
pg8000
23
psycopg2
34
http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip
45
-e git+https://github.com/davispuh/MySQL-for-Python-3#egg=MySQL-python
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"""pg8000 test."""
2+
import os
3+
import unittest
4+
import logging
5+
from nose.exc import SkipTest
6+
from . import context_case
7+
from . import graph_case
8+
if os.environ.get('DB') != 'pgsql':
9+
raise SkipTest("PgSQL not under test")
10+
try:
11+
import pg8000
12+
assert pg8000 is not None
13+
except ImportError:
14+
raise SkipTest("pg8000 not installed, skipping PgSQL tests")
15+
_logger = logging.getLogger(__name__)
16+
17+
sqlalchemy_url = os.environ.get(
18+
'DBURI',
19+
'postgresql+pg8000://postgres@localhost/test')
20+
21+
22+
class SQLAPgSQLGraphTestCase(graph_case.GraphTestCase):
23+
"""Graph test case."""
24+
25+
storetest = True
26+
storename = "SQLAlchemy"
27+
uri = sqlalchemy_url
28+
create = True
29+
30+
def setUp(self):
31+
"""Setup."""
32+
super(SQLAPgSQLGraphTestCase, self).setUp(
33+
uri=self.uri, storename=self.storename)
34+
35+
def tearDown(self):
36+
"""Teardown."""
37+
super(SQLAPgSQLGraphTestCase, self).tearDown(uri=self.uri)
38+
39+
40+
class SQLAPgSQLContextTestCase(context_case.ContextTestCase):
41+
"""Context test case."""
42+
43+
storetest = True
44+
storename = "SQLAlchemy"
45+
uri = sqlalchemy_url
46+
create = True
47+
48+
def setUp(self):
49+
"""Setup."""
50+
super(SQLAPgSQLContextTestCase, self).setUp(
51+
uri=self.uri, storename=self.storename)
52+
53+
def tearDown(self):
54+
"""Teardown."""
55+
super(SQLAPgSQLContextTestCase, self).tearDown(uri=self.uri)
56+
57+
def testLenInMultipleContexts(self):
58+
"""Test lin in multiple contexts, known issue."""
59+
raise SkipTest("Known issue.")
60+
61+
# SQLAPgSQLGraphTestCase.storetest = True
62+
# SQLAPgSQLContextTestCase.storetest = True
63+
64+
if __name__ == '__main__':
65+
unittest.main()

0 commit comments

Comments
 (0)