Open odoo-sh opened 2 years ago
Try adding the -v
argument. I had a similar problem a month ago and this fixed it, for some reason...
Are you sure the module is installed? Can you run tests w/ std odoo command? odoo -d XXX -i $mod_name --stop-after-init --test-enable
?
Hello,
yes, the module is installed as you can see in runtest.log
We are executing pytest at first followed by odoo --test-enable. runtests.log
UPDATE: the run test with standard odoo command succeed.
Are you sure tests are running w/ odoo? Do you import your test file in tests/__init__.py
?
Bear in mind that if this is not the case, pytest will find it, odoo won't.
Very likely you have a problem on an import.
yes. we did import our testfile in tests/__init__.py
odoo -d xxx -i $mod_name --stop-after-init --test-enable succeed.
As a workaround we changed the following and it worked.
Commented line 122: pkgroot = pypkgpath.dirpath()
Changed line 124:
names = self.fspath.new(ext="").relto(pkgroot).split(sep)
To
names = self.fspath.new(ext="").relto(pypkgpath).split(sep)
ok, but the fact that I see no module named 'odoo.addons.tiny_apps'
makes me think you have a problem.
AFAIS tiny_apps
is a folder and not and addon.
However is a bit hard to judge w/out knowing your setup.
yes tiny_apps is a folder. we have addons_path=... , /odoo/src/tiny_apps/tiny_apps, .....
tiny_apps folder has many modules with test.
We want to run pytest for selective modules.
@odoo-sh export the OPENERP_SERVER environment variable
In terminal
export OPENERP_SERVER=/path/to/odoo.cfg
or in your bashrc or zshrc file append
export OPENERP_SERVER=/path/to/odoo.cfg
and reload the shell with exec $SHELL
Hello,
Trying to run a test per module using cmd but getting import errors. any idea? pytest --odoo-config=/odoo/conf/odoo.cfg --odoo-database=testdb --odoo-log-level=debug --junitxml=junit-report.xml -s /odoo/src/tiny_apps/tiny_apps/purchase_batch_order