Development

You can help developing PyMySQL by contributing on GitHub.

Building the documentation

Go to the docs directory and run make html.

Test Suite

If you would like to run the test suite, create a database for testing like this:

  1. mysql -e 'create database test_pymysql DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'
  2. mysql -e 'create database test_pymysql2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'

Then, copy the file .travis/database.json to pymysql/tests/databases.json and edit the new file to match your MySQL configuration:

  1. $ cp .travis/database.json pymysql/tests/databases.json
  2. $ $EDITOR pymysql/tests/databases.json

To run all the tests, execute the script runtests.py:

  1. $ python runtests.py

A tox.ini file is also provided for conveniently running tests on multiple Python versions:

  1. $ tox