Closed samsagaz closed 4 years ago
Hi @samsagaz,
I never tried with python 3.8, could you check if you have the same issue with for instance 3.7?
Another issue could be the way odoo
is installed into your virtualenv, how did you install it? (should work with pip install -e path/to/odoo
)
You could try to put a pdb.set_trace()
just before the line odoo.registry(odoo.tests.common.get_db_name())
and inspect what is odoo
there.
Hi @guewen i installed odoo using pip install -e . (in my odoo path) after that i get another error.
__ ERROR collecting working-addons/custom_stock/tests/test_base_cases.py ___ ../../../../.virtualenvs/citrux/lib/python3.8/site-packages/pytest_odoo.py:137: in _importtestmodule import(modname) odoo/modules/module.py:61: in load_module f, path, (_suffix, mode, type) = imp.find_module(addon_name, ad_paths) ../../../../.virtualenvs/citrux/lib/python3.8/imp.py:296: in find_module raise ImportError(_ERR_MSG.format(name), name=name) E ImportError: No module named 'custom_stock' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ===================================================================================================================== 1 error in 0.17s =====================================================================================================================
the only way to get it working is just to copy my custom_stock module inside my_odoo_root/odoo/addons/custom_stock :/
Seems like your addons_path
option is not set correctly.
You can either provide a configuration file with an addons path that contains your module, either install your module with pip -e install
as well (you'll need to generate setuptools files beforehand with setuptools-odoo-make-default -d .
using https://pypi.org/project/setuptools-odoo).
This is not related to pytest-odoo
, you'll have the same requirement to start your server.
First of all, thanks for this pytest plugin. i want to know if someome know why i cant use it in my machine :/
Im using Odoo12 and Python3.8
test is
class TestBase: def test_config(self): assert 1 == 2
error
___ ERROR at setup of TestBase.test_config ___
/home/user/.virtualenvs/odoo/lib/python3.8/site-packages/pytest_odoo.py:89: AttributeError
as you can see im running the instance inside a virtualenv