Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering test using odoo test tagged - how to avoid running at_install test ? #37

Open
petrus-v opened this issue Jan 19, 2021 · 2 comments

Comments

@petrus-v
Copy link

I'd like to skip test class decorated with the "at_install" odoo test tags while running my test using pytest.

Is there already some way to do so without adding extra line in code source ?

It works properly using Skip decorator @pytest.mark.skip(reason="Do not run at install test using pytest"), I was wondering if there are some plan to provide those tags as pytest marker to be able to filter those tests ?

@yvaucher
Copy link
Member

Hello @petrus-v ,

Could you elaborate? Pytest doesn't run the tests at_install.

You can refer to @guewen comment in #26 (comment)

The at_install doesn't make much sense with pytest-odoo. You prepare first your database, then execute tests.

Usually what you want is to execute only a selection of tests, like your custom modules. As Odoo source code and OCA are already covered by their respective tests. It could be redundant to run them again locally. You might want a selection of Odoo core tests to validate you don't break anything but you might prefer to copy those tests and extend them as your workflow might have some customization to tests or that breaks odoo core tests.

@petrus-v
Copy link
Author

petrus-v commented Mar 23, 2021

I'm using pytest as development tool.

I've 2 case where I get tests with the at_install

  • My project is split in different module where I've few corner case where it make sense to use at_install flag as some parts are overwriting (I'm using odoo --test-enable to launch them)
  • Or while fixing/investigate issue to odoo/communautary modules

As a developer I want to execute test using pytest, I was wondering if at_install are discoverd as pytest marker to not launch those at_install tests easly ?

@petrus-v petrus-v changed the title Filtering test using odoo test tagged Filtering test using odoo test tagged - how to avoid running at_install test ? Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants