fix: move odoo_env fixture to root conftest.py
conftest.py inside the addon directory causes pytest to import the package directly (bypassing the odoo.addons.* namespace), triggering an AssertionError in Odoo's metaclass. Moving the fixture to the repo-root conftest.py avoids the import path issue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fd0fa24569
commit
243a7b0428
2 changed files with 7 additions and 7 deletions
|
|
@ -1,7 +0,0 @@
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def odoo_env(env):
|
|
||||||
"""Re-export pytest-odoo's env fixture for use in pytest-bdd step definitions."""
|
|
||||||
return env
|
|
||||||
|
|
@ -4,6 +4,13 @@ Installs the addon into the test database before any test code runs.
|
||||||
"""
|
"""
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def odoo_env(env):
|
||||||
|
"""Re-export pytest-odoo's env fixture for use in pytest-bdd step definitions."""
|
||||||
|
return env
|
||||||
|
|
||||||
|
|
||||||
print(">>> conftest.py loaded", file=sys.stderr)
|
print(">>> conftest.py loaded", file=sys.stderr)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue