pytest-mysql

This is a pytest plugin, that enables you to test your code that relies on a running MySQL Database. It allows you to specify fixtures for MySQL process and client.

Warning

Only MySQL 5.7.6 and up are supported. For older versions, please use pytest-mysql 2.0.3 Although Pull Request to add back support for older MySQL versions are welcome.

How to use

Plugin contains two fixtures

  • mysql - it’s a client fixture that has functional scope. After each test drops test database from MySQL ensuring repeatability.
  • mysql_proc - session scoped fixture, that starts MySQL instance at it’s first use and stops at the end of the tests.

#database #mysql

Test your code that relies on a running MySQL Database
2.65 GEEK