$npx skillfedfor your agent

pytest-mysql

MySQL process and client fixtures for pytest

Worth itPyPI Python ModulesReleased Apr 2026276.1K downloads / mocopyleft licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_mysql-4.0.0-py3-none-any.whl
v4.0.0 · released 2026-04-12 · Python >=3.10 · 5 runtime deps: pytest, port-for, mirakuru, pymysql, packaging

Yes. This is a stable, actively maintained plugin with low install friction and no known vulnerabilities. It solves a real problem—automating MySQL test infrastructure—and is widely used. The LGPLv3+ license is permissive for test code. Install it if your test suite needs a managed MySQL database.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires MySQL 8.0+ or MariaDB 10.11+ installed on the test machine; mysqld and mysqladmin binaries must be in PATH or configured via fixture arguments.
  • Low friction install with five runtime dependencies (pytest, port-for, mirakuru, pymysql, packaging).
  • Actively maintained with recent releases.

License · maintenance · safety

copyleft license (copyleft) — Licensed under LGPLv3+, a copyleft license. Your test code using this plugin must comply with LGPL terms; derivative works of the plugin itself require source disclosure, but linking to it from proprietary tests is permitted under LGPL's library exception.

last release 2026-04-12 (124 days) · last repo commit 2026-08-12 · 58 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 276,115 downloads/mo, #8,167 on PyPI

Verify before relying

pip install pytest-mysql

In conftest.py or test file:
from pytest_mysql import factories
mysql_proc = factories.mysql_proc()
mysql = factories.mysql('mysql_proc')

def test_example(mysql):
    cur = mysql.cursor()
    cur.execute('SELECT 1')
    mysql.commit()
  • Whether the plugin supports Python versions beyond 3.14 or if 3.14 is the current ceiling.
  • Performance characteristics when running many concurrent test fixtures or large test suites.
  • Compatibility with MySQL 8.1+ or MariaDB 11.0+ versions released after the tested range.
Same gist for agents: .md · .json

What it is and 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.

You use it by installing the plugin and then importing fixtures into your test suite. Configuration is flexible—you 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.

Use it for

  • 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.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a stable, actively maintained plugin with low install friction and no known vulnerabilities. It solves a real problem—automating MySQL test infrastructure—and is widely used. The LGPLv3+ license is permissive for test code. Install it if your test suite needs a managed MySQL database.

Install

pytest-mysql on PyPI

Before you install

Low friction install with five runtime dependencies (pytest, port-for, mirakuru, pymysql, packaging). Actively maintained with recent releases.

Requires MySQL 8.0+ or MariaDB 10.11+ installed on the test machine; mysqld and mysqladmin binaries must be in PATH or configured via fixture arguments.

License in practice

Licensed under LGPLv3+, a copyleft license. Your test code using this plugin must comply with LGPL terms; derivative works of the plugin itself require source disclosure, but linking to it from proprietary tests is permitted under LGPL's library exception.

Quickstart

pip install pytest-mysql

In conftest.py or test file:
from pytest_mysql import factories
mysql_proc = factories.mysql_proc()
mysql = factories.mysql('mysql_proc')

def test_example(mysql):
    cur = mysql.cursor()
    cur.execute('SELECT 1')
    mysql.commit()

Verify before relying

  • Whether the plugin supports Python versions beyond 3.14 or if 3.14 is the current ceiling.
  • Performance characteristics when running many concurrent test fixtures or large test suites.
  • Compatibility with MySQL 8.1+ or MariaDB 11.0+ versions released after the tested range.

Package facts

Licensecopyleft license copyleft
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
pytestport-formirakurupymysqlpackaging
MaintenanceActively maintained 124 days since the last release
Last repo commit
First released
Downloads276,115 / month, #8,167 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Testing

Evidence: pytest_mysql-4.0.0-py3-none-any.whl

Tags

Capabilities
pytest mysql fixturemysql testing pluginmariadb pytestdatabase test fixturesmysql process managementpytest database setupmysql test isolation
Topics
pytest-plugindatabase-testingmysql-mariadb
PyPI keywords
testspytestfixturemysql

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pytest mysql fixture”

  • pytest-mysqlA pytest plugin that provides MySQL and MariaDB fixtures for…
  • pytest-databasesProvides pytest fixtures that spin up isolated database services in…
  • pytest-mock-resourcesProvides pytest fixtures that spin up real database and service…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also pytest-postgresql · pytest-rabbitmq · pytest-redis · pytest-spark · mysql-replication · pytest-mock-resources · pytest-databases · pytest-docker · pytest-deadfixtures · pytest-unused-fixtures