Mysql test skipped if pymysql not installed
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
import sqlalchemy as sa
|
from pytest import mark
|
||||||
|
pymysql = None
|
||||||
|
try:
|
||||||
|
import pymysql
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
import os
|
import os
|
||||||
from tests import TestCase
|
from tests import TestCase
|
||||||
|
|
||||||
from sqlalchemy_utils import (
|
from sqlalchemy_utils import (
|
||||||
create_database,
|
create_database,
|
||||||
drop_database,
|
drop_database,
|
||||||
@@ -30,6 +36,7 @@ class TestDatabaseSQLite(DatabaseTest):
|
|||||||
assert database_exists('sqlite:///:memory:')
|
assert database_exists('sqlite:///:memory:')
|
||||||
|
|
||||||
|
|
||||||
|
@mark.skipif('pymysql is None')
|
||||||
class TestDatabaseMySQL(DatabaseTest):
|
class TestDatabaseMySQL(DatabaseTest):
|
||||||
url = 'mysql+pymysql://travis@localhost/db_test_sqlalchemy_util'
|
url = 'mysql+pymysql://travis@localhost/db_test_sqlalchemy_util'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user