Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.so
*.pyd
*.gz
.*.sw[a-z]
*.zip
*.egg
*.egg-info/
Expand Down
40 changes: 40 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
First, run a little mysql server in your home directory.

*NOTE:* The below setup is quite insecure and should be shutdown and deleted when testing is concluded.

mkdir -p ~/tmp/mysqldb-test-server/
cd !$

mysql_install_db --no-defaults --user=$USER --datadir=$PWD/data --socket=$PWD/mysql.sock --force
/usr/sbin/mysqld --no-defaults --user=$USER --datadir=$PWD/data --socket=$PWD/mysql.sock --port 33060


Now edit tests/default.cnf to add the port and change the user to 'root':

port = 33060
user = root


Install nose:

pip install nose


Populate your new DB with a test table:

echo 'create database test;' | mysql --port 33060 -h 0.0.0.0 -u root


Finally, run the tests:

cd PATH/TO/MYSQLDB && nosetests


When you're done, stop the server:

cd ~/tmp/mysqldb-test-server && cat data/*.pid | xargs kill


Remove its data:

rm -rf data
1 change: 1 addition & 0 deletions tests/default.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

[MySQLdb-tests]
host = 127.0.0.1
port = 3306
user = test
database = test
#password =
Expand Down