diff --git a/pytest_odoo.py b/pytest_odoo.py index 09e1f84..6e27c90 100644 --- a/pytest_odoo.py +++ b/pytest_odoo.py @@ -39,6 +39,11 @@ def pytest_addoption(parser): action="store") parser.addoption("--odoo-addons-path", action="store") + parser.addoption("--odoo-extra", + action="append", + default=[], + help="Extra options to pass to odoo " + "(e.g. --odoo-extra workers=0 --odoo-extra db-filter=odoo_test)") @pytest.hookimpl(hookwrapper=True) @@ -65,6 +70,10 @@ def pytest_cmdline_main(config): odoo_arg = '--%s' % option[7:] options.append('%s=%s' % (odoo_arg, value)) + extra_options = config.getoption("--odoo-extra") + for extra_option in extra_options: + options.append('--%s' % extra_option) + # Check the environment variables supported by the Odoo Docker image # ref: https://hub.docker.com/_/odoo for arg in ['HOST', 'PORT', 'USER', 'PASSWORD']: