mercredi 29 juin 2016

ODOO [V8] Unit Tests

I'm actually trying to run the unittests I've created thanks to Odoo's documentation.

I've built my module like this :

module_test
- __init__.py
  __openerp.py__
... 
- tests
   __init__.py
   test_1.py

Inside 'module_test/tests/init.py', I do have "import test_1" Inside, 'module_test/tests/test_1.py", I do have : "import tests + a test scenario I've written.

Then I launch the command line to run server, and I add : '-u module_test --log-level=test --test-enable' to update the module and activate the tests run

The shell returns : "All post-tested in 0.00s, 0 queries". So in fact, no tests are run.

I then added a syntax error, so the file can't be compiled by the server, but shell returned the same sentence. It looks like the file is ignored, and the server is not even trying to compile my file... I do not understand why ?

I've checked some Odoo source module, the 'sale' one for example. I've tried to run sale tests, shell returned the same value than before. I added syntax error inside sale tests, shell returned the same value again, and again.

Does anyone have an idea about this unexpected behavior ?

Thank you...!

Aucun commentaire:

Enregistrer un commentaire