Add dependency test matrix

This commit is contained in:
Konsta Vesterinen
2014-12-16 15:46:27 +02:00
parent 85170dfb58
commit de9dc676be
4 changed files with 9 additions and 10 deletions

View File

@@ -13,7 +13,12 @@ python:
- 3.3 - 3.3
- 3.4 - 3.4
env:
- EXTRAS=test
- EXTRAS=test_all
install: install:
- pip install -e ".[test]" - pip install -e .[$EXTRAS]
script: script:
- py.test - py.test

View File

@@ -36,7 +36,6 @@ extras_require = {
'pytz>=2014.2', 'pytz>=2014.2',
'python-dateutil>=2.2', 'python-dateutil>=2.2',
'pymysql', 'pymysql',
'colour>=0.0.4'
], ],
'anyjson': ['anyjson>=0.3.3'], 'anyjson': ['anyjson>=0.3.3'],
'babel': ['Babel>=1.3'], 'babel': ['Babel>=1.3'],
@@ -53,9 +52,10 @@ extras_require = {
# Add all optional dependencies to testing requirements. # Add all optional dependencies to testing requirements.
test_all = []
for name, requirements in extras_require.items(): for name, requirements in extras_require.items():
if name != 'test': test_all += requirements
extras_require['test'] += requirements extras_require['test_all'] = test_all
setup( setup(

View File

@@ -17,10 +17,6 @@ def count_sql_calls(conn, cursor, statement, parameters, context, executemany):
conn.query_count += 1 conn.query_count += 1
except AttributeError: except AttributeError:
conn.query_count = 0 conn.query_count = 0
try:
conn.queries.append(statement)
except AttributeError:
conn.queries = [statement]
warnings.simplefilter('error', sa.exc.SAWarning) warnings.simplefilter('error', sa.exc.SAWarning)
@@ -59,7 +55,6 @@ class TestCase(object):
def teardown_method(self, method): def teardown_method(self, method):
aggregates.manager.reset() aggregates.manager.reset()
self.session.close_all() self.session.close_all()
self.connection.queries = []
if self.create_tables: if self.create_tables:
self.Base.metadata.drop_all(self.connection) self.Base.metadata.drop_all(self.connection)
self.connection.close() self.connection.close()

View File

@@ -76,6 +76,5 @@ class TestAggregateManyToManyAndManyToMany(TestCase):
catalog2 = self.Catalog(products=products) catalog2 = self.Catalog(products=products)
self.session.add(catalog) self.session.add(catalog)
self.session.commit() self.session.commit()
print self.connection.queries[-1]
assert catalog.category_count == 1 assert catalog.category_count == 1
assert catalog2.category_count == 1 assert catalog2.category_count == 1