skillfed

pytest-odoo

py.test plugin to run Odoo tests

pytest-odoo v2.2.0 90.8K downloads/30d#13,561 on PyPI87
AGPL license AGPLv3 Active released

What it is and what it does

pytest-odoo bridges Odoo's unittest-based addon tests with pytest, letting developers run tests via pytest's CLI and ecosystem instead of Odoo's slower upgrade-based test runner. It's designed as a development-time tool for faster TDD iteration: you upgrade your addon once, then run tests repeatedly without re-upgrading. The plugin supports pytest-xdist for parallel test execution (creating isolated database copies per worker) and pytest-subtests for granular failure reporting.

The package requires Python 3.8 or later and depends only on pytest. It accepts Odoo configuration via command-line flags (--odoo-database, --odoo-log-level, --odoo-config, --odoo-http, --odoo-skip-at-install) or environment variables (HOST, PORT, USER, PASSWORD, ODOO_RC). The documentation notes that pytest-odoo treats all tests as post-install by default and should complement, not replace, Odoo's native --test-enable in CI pipelines.

Use it for:

  • Rapid test-driven development of Odoo addons without waiting for full module upgrades on each test run
  • Running Odoo addon tests in parallel across multiple workers using pytest-xdist for faster feedback
  • Integrating Odoo addon tests into a pytest-based CI/CD pipeline alongside other Python tests
  • Debugging individual addon tests with pytest's verbose output and filtering capabilities
  • Skipping at-install tests during development to focus on post-install test scenarios

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pytest-odoo is a pytest plugin that runs Odoo addon tests using pytest's CLI instead of Odoo's built-in test runner, enabling faster iteration during development.

Yes, if you develop Odoo addons and want faster test iteration during development. Install it as a dev dependency alongside pytest. Be aware of the AGPLv3 license if your project has commercial distribution requirements, and remember that pytest-odoo is a development accelerator, not a replacement for Odoo's native test runner in CI—use both for complete coverage.

Install

pytest-odoo on PyPI

pip

pip install pytest-odoo

uv

uv add pytest-odoo

poetry

poetry add pytest-odoo

Installing pytest-odoo

Before you install

Low friction install with a single runtime dependency (pytest). The package is actively maintained with a recent release 43 days ago and has been stable since its 2016 initial release.

License in practice

Licensed under AGPLv3, which requires that any derivative works or distributions must also be open-source under the same license. This is a strong copyleft requirement suitable for internal tools and open-source projects but may restrict commercial closed-source use.

Quickstart

pip install pytest-odoo

pytest -s --odoo-database=test --odoo-log-level=debug_sql

Requires a running Odoo instance and database; system dependencies (libxml2-dev, libxslt1-dev, libpq-dev, etc.) needed for integration testing on Debian/Ubuntu.

Verify before relying

  • Compatibility with specific Odoo versions (ERP framework versions supported by pytest-odoo 2.2.0)
  • Performance characteristics when running large test suites compared to Odoo's native --test-enable
  • Whether pytest-xdist distributed testing works reliably with all Odoo addon patterns

Package facts

License AGPLv3 (agpl)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pytest
Maintenance actively maintained — 43 days since the last release
Last repo commit
First released
Downloads 90,829/month — #13,561 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_odoo-2.2.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Affero General Public License v3Operating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities

Tags

pytest plugin for odooodoo test runnerodoo addon testingpytest odoo integrationodoo unittest with pytestodoo tdd developmentodoo test framework
odoo-developmentpytest-plugintdd-acceleration

More Libraries packages