diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-10 06:31:32 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 06:31:32 +0000 |
commit | ff44ee39886caead3992b7b2e216a325eab04275 (patch) | |
tree | 7270efff76a40abf64e5fbf127d6af64e9fd615d | |
parent | fbb4143c7a8cdf25809b798c760bc4f2471adfbe (diff) |
automatic import of python-pytest-odoo
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pytest-odoo.spec | 103 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 105 insertions, 0 deletions
@@ -0,0 +1 @@ +/pytest-odoo-0.9.1.tar.gz diff --git a/python-pytest-odoo.spec b/python-pytest-odoo.spec new file mode 100644 index 0000000..d806d26 --- /dev/null +++ b/python-pytest-odoo.spec @@ -0,0 +1,103 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pytest-odoo +Version: 0.9.1 +Release: 1 +Summary: py.test plugin to run Odoo tests +License: AGPLv3 +URL: https://github.com/camptocamp/pytest-odoo +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/90/5a/5cba6755a3a33345275d6b31dd24e61b4ef335f8cd9988722a3c5ca543f6/pytest-odoo-0.9.1.tar.gz +BuildArch: noarch + +Requires: python3-pytest + +%description +pytest plugin to run Odoo tests +This lib allows to run the tests built in Odoo addons which are using Python's `unittest <https://docs.python.org/3/library/unittest.html>`_, but with the comfort of the `pytest <https://docs.pytest.org/>`_ CLI. +Also allowing to run tests without updating given module. +Odoo's `--test-enable` machinery and pytest-odoo do not cover exactly the same scope. The Odoo's test runner runs the tests during +the upgrades of the addons, that's why they need the "at install" and "post install" markers. +Running tests during upgrades of addons is waaay too slow to work efficiently in a TDD mode, that's where pytest-odoo shines. +Consider that all the tests are running `post-install` with pytest-odoo, as you must run the upgrade of the addon before (but only when needed vs each run). +At the end of the day, its beneficial to run the Odoo tests with `--test-enable` because, as in very rare conditions, +a test can pass with pytest-odoo but not with the "at install" tests run during the upgrade (or the oposite). +Pytest-odoo can be considered a development tool, but not the tool that should replace entirely `--test-enable` in a CI. +See also the `official Odoo documentation <https://www.odoo.com/documentation/15.0/developer/reference/backend/testing.html#testing-python-code>`_ on writing tests. + +%package -n python3-pytest-odoo +Summary: py.test plugin to run Odoo tests +Provides: python-pytest-odoo +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pytest-odoo +pytest plugin to run Odoo tests +This lib allows to run the tests built in Odoo addons which are using Python's `unittest <https://docs.python.org/3/library/unittest.html>`_, but with the comfort of the `pytest <https://docs.pytest.org/>`_ CLI. +Also allowing to run tests without updating given module. +Odoo's `--test-enable` machinery and pytest-odoo do not cover exactly the same scope. The Odoo's test runner runs the tests during +the upgrades of the addons, that's why they need the "at install" and "post install" markers. +Running tests during upgrades of addons is waaay too slow to work efficiently in a TDD mode, that's where pytest-odoo shines. +Consider that all the tests are running `post-install` with pytest-odoo, as you must run the upgrade of the addon before (but only when needed vs each run). +At the end of the day, its beneficial to run the Odoo tests with `--test-enable` because, as in very rare conditions, +a test can pass with pytest-odoo but not with the "at install" tests run during the upgrade (or the oposite). +Pytest-odoo can be considered a development tool, but not the tool that should replace entirely `--test-enable` in a CI. +See also the `official Odoo documentation <https://www.odoo.com/documentation/15.0/developer/reference/backend/testing.html#testing-python-code>`_ on writing tests. + +%package help +Summary: Development documents and examples for pytest-odoo +Provides: python3-pytest-odoo-doc +%description help +pytest plugin to run Odoo tests +This lib allows to run the tests built in Odoo addons which are using Python's `unittest <https://docs.python.org/3/library/unittest.html>`_, but with the comfort of the `pytest <https://docs.pytest.org/>`_ CLI. +Also allowing to run tests without updating given module. +Odoo's `--test-enable` machinery and pytest-odoo do not cover exactly the same scope. The Odoo's test runner runs the tests during +the upgrades of the addons, that's why they need the "at install" and "post install" markers. +Running tests during upgrades of addons is waaay too slow to work efficiently in a TDD mode, that's where pytest-odoo shines. +Consider that all the tests are running `post-install` with pytest-odoo, as you must run the upgrade of the addon before (but only when needed vs each run). +At the end of the day, its beneficial to run the Odoo tests with `--test-enable` because, as in very rare conditions, +a test can pass with pytest-odoo but not with the "at install" tests run during the upgrade (or the oposite). +Pytest-odoo can be considered a development tool, but not the tool that should replace entirely `--test-enable` in a CI. +See also the `official Odoo documentation <https://www.odoo.com/documentation/15.0/developer/reference/backend/testing.html#testing-python-code>`_ on writing tests. + +%prep +%autosetup -n pytest-odoo-0.9.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pytest-odoo -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.9.1-1 +- Package Spec generated @@ -0,0 +1 @@ +d1967f6c15e866c9c5e0e0c868dcb58f pytest-odoo-0.9.1.tar.gz |