From 48d22b920ad2bdab18db1d6a388c8d7de43e1c88 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 30 Jul 2024 11:04:45 +0200 Subject: [PATCH] [FIX] mergebot coverage - add context, in case that allows tracking overlap between tests eventually - use `-m` to run odoo, requires backporting `odoo/__main__.py` but I'm not quite sure how I was running it previously, possibly via odoo-bin? It certainly doesn't seem to work out with a global `odoo` helper --- conftest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 66afa127..610a75d3 100644 --- a/conftest.py +++ b/conftest.py @@ -451,7 +451,13 @@ def server(request, db, port, module, addons_path, tmpdir): cov = [] if request.config.getoption('--coverage'): - cov = ['coverage', 'run', '-p', '--source=odoo.addons.runbot_merge,odoo.addons.forwardport', '--branch'] + cov = [ + 'coverage', 'run', + '-p', '--branch', + '--source=odoo.addons.runbot_merge,odoo.addons.forwardport', + '--context', request.node.nodeid, + '-m', + ] r, w = os.pipe2(os.O_NONBLOCK) buf = bytearray()