Closed mevimo closed 1 year ago
it must be installed in the same python env where odoo is installed. And you have to follow this instructions https://github.com/camptocamp/pytest-odoo#usage
My question was not how to get it to work, I can do that just fine. Let me rephrase: I don't see how anyone's Odoo directory can end up in pythonpath automatically, so either I'm missing something or the readme is.
@MeViMo I'm using PyCharm for development, and that's how I do it:
So I just have Odoo in my project and use PyCharm's "Project Dependencies".
@MeViMo you have to install odoo
as a Python package in the same Python environment where you installed pytest
, let's say you git-cloned Odoo in ./src/
:
$ cd ./src/
$ pip install -r requirements.txt
$ pip install -e .
$ python
>>> import odoo
>>> odoo
<module 'odoo' from '[...]/src/odoo/__init__.py'>
>>>
$ which odoo
[...]/src/.venv/bin/odoo
Damn, my bad, I didn't even realize Odoo had a setup.py and people were installing it as a Python package.
I checked on the official documentation and this install is not documented (or partially, some bits are missing)...
I don't understand, the script is invoked by pytest, under Python site-packages. How could it ever find Odoo there to import?