-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As Odoo is an heavy piece of software and we don't have to check if it runs. So we can mock the import. For further unit tests, the few methods we use will have to be mocked too. Changes in the CI replaces unittest by pytest configure codecov use tox test pytest addon with pytest Test with pytester use pytest-cov Use tox fix coverage data collection xml report for codecov Set token for codecov Upgrade GH action codecov to v4
- Loading branch information
Showing
7 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
omit = tests/* | ||
setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
*.egg-info | ||
*.pyc | ||
.cache/ | ||
dist/ | ||
# Byte-compiled / optimized / DLL | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
build/ | ||
dist/ | ||
eggs/ | ||
.eggs/ | ||
*.egg-info/ | ||
*.egg | ||
|
||
# Unit test / coverage reports | ||
.tox | ||
.coverage | ||
.coverage.* | ||
.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from mock import MagicMock | ||
registry = MagicMock() | ||
tools = MagicMock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from mock import MagicMock | ||
common = MagicMock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from setuptools import find_packages, setup | ||
|
||
setup( | ||
name="odoo", | ||
version="0.0.1", | ||
packages=find_packages(), | ||
package_dir={"odoo": "odoo"}, | ||
install_requires="mock" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[testenv] | ||
deps = pytest | ||
pytest-cov | ||
coverage | ||
commands = | ||
pip install tests/mock/odoo | ||
pytest --cov=pytest_odoo . --cov-report=xml |