Source code for sqlobject.tests.test_mysql
import pytest
from sqlobject import SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
try:
connection = getConnection()
except (AttributeError, NameError):
# The module was imported during documentation building
pass
else:
if connection.dbName != "mysql":
pytestmark = pytest.mark.skip('')
[docs]class SOTestSOListMySQL(SQLObject):
pass
[docs]def test_list_databases():
assert connection.db in connection.listDatabases()
[docs]def test_list_tables():
setupClass(SOTestSOListMySQL)
assert SOTestSOListMySQL.sqlmeta.table in connection.listTables()