{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/14"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"A pytest plugin that provides MySQL and MariaDB fixtures for testing\u2014manages both local database processes and connections to running instances, with automatic cleanup between tests.","skillfed_tags":["pytest-plugin","database-testing","mysql-mariadb"],"use_cases":["Write integration tests that verify application code against a real MySQL database without manual server management.","Run isolated test suites in CI/CD pipelines where each test gets a clean database and the server starts and stops automatically.","Connect tests to a MySQL instance running in Docker or on a remote host using the noproc fixture.","Populate test databases with SQLAlchemy ORM or raw SQL and verify application behavior against schema changes.","Configure different MySQL instances for different test fixtures with custom ports, users, and parameters."],"what_it_does":"pytest-mysql is a pytest plugin that automates MySQL and MariaDB database setup for integration tests. It provides three main fixtures: mysql (a function-scoped client that drops the test database after each test), mysql_proc (a session-scoped process that starts a local MySQL instance), and mysql_noproc (a session-scoped fixture for connecting to an already-running database). The plugin depends on pytest, port-for, mirakuru, pymysql, and packaging to manage process lifecycle, port allocation, and database connections.\n\nYou use it by installing the plugin and then importing fixtures into your test suite. Configuration is flexible\u2014you can set options via fixture factory arguments, command-line flags, or pytest.ini entries. The plugin handles port discovery, database creation, user authentication, and cleanup automatically, making it straightforward to write repeatable database tests without manual setup or teardown boilerplate.","worth_installing":"Yes. This is a stable, actively maintained plugin with low install friction and no known vulnerabilities. It solves a real problem\u2014automating MySQL test infrastructure\u2014and is widely used. The LGPLv3+ license is permissive for test code. Install it if your test suite needs a managed MySQL database."},"id":"pytest-mysql","links":{"html":"https://skillfed.io/packages/pytest-mysql","md":"https://skillfed.io/packages/pytest-mysql.md","pypi":"https://pypi.org/project/pytest-mysql/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-12","license_spdx":null,"license_treatment":"copyleft","name":"pytest-mysql","python_support":"supports_current","summary":"MySQL process and client fixtures for pytest"},"popularity":{"monthly_downloads":276115,"position":8167,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"4.0.0"}
