Skip to content

Commit

Permalink
Merge pull request #71 from akretion/add-odoo-extra
Browse files Browse the repository at this point in the history
Add --odoo-extra option
  • Loading branch information
simahawk authored Sep 20, 2024
2 parents ea53560 + d8d1cea commit 095ca9f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pytest_odoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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']:
Expand Down

0 comments on commit 095ca9f

Please sign in to comment.