travis-ci.org でテストを行います。
テストコードは
import MySQLdb
create_tbl_SQL = open("tables.sql").read()
conn = MySQLdb.connect(db = "test_travis", user = "root", passwd = "", charset = "utf8", host = "localhost", port = 3306)
def create_tables():
conn.cursor().execute(create_tbl_SQL)
def drop_tables():
conn.cursor().execute("drop table user, post;")
create_tables()
conn1 = MySQLdb.connect(db = "test_travis", user = "root", passwd = "", charset = "utf8", host = "localhost", port = 3306)
c = conn1.cursor()
c.execute("insert into user set user.name = '111'")
c.execute("select * from user; ")
drop_tables()
ただし、travis-ci.org のテストでは、これを実行するのに 3 分かかります。
このコードは github にあります: https://github.com/hit9/test_mysql_on_travis/
travis-ci.org でのこのテスト:https://travis-ci.org/hit9/test_mysql_on_travis
「テーブルのドロップ」アクションにより、このスクリプトの実行が遅くなると思います。
しかし、どうすればこれを解決できますか?