-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Introduce tox for testing #197
Conversation
setup.py
Outdated
@@ -16,6 +16,6 @@ | |||
author_email='info@precice.org', | |||
license='LGPL-3.0', | |||
packages=['fenicsprecice'], | |||
install_requires=['pyprecice>=3.0.0.0', 'scipy<1.15.0', 'numpy>=1.13.3, <2', 'mpi4py<4'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have to revert this before merging but ok during development to avoid having to install preCICE on the system.
* Remove unnecessary `run` command * Install tox via apt to avoid unnecessary stage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a minor thing left. But besides that everything works very well and is a super useful (and extremely overdue) update for this repository. Thank you very much :)
Where I'm still struggling:
If I run the following command:
tox -e unit -- tests/test_write_read.py::TestWriteandReadData::test_vector_write
I get the following output:
unit: commands[0]> pytest tests/unit
==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.5.0
cachedir: .tox/unit/.pytest_cache
rootdir: /home/benjamin/Programming/fenics-adapter
configfile: pyproject.toml
collected 5 items
tests/unit/test_adapter_core.py .. [ 40%]
tests/unit/test_checkpointing.py ... [100%]
====================================================================================================================== warnings summary ======================================================================================================================
../../../../usr/lib/python3/dist-packages/dijitso/__init__.py:19
/usr/lib/python3/dist-packages/dijitso/__init__.py:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import get_distribution
../../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:2871
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================================================================================== 5 passed, 2 warnings in 5.09s ================================================================================================================
unit: OK (5.75=setup[0.07]+cmd[5.68] seconds)
congratulations :) (5.87 seconds)
This looks to my like all tests in unit
are run. However, actually I would like to only see a single test being run. https://stackoverflow.com/a/49935307 gives already a hint: You need pytest {posargs}
somewhere in the commands. I personally would not start duplicating this in unit
and integration
. Instead, it would probably make sense to have a third environment (all
?) where we run all tests by default and apply the filtering only if given by the user. The command that we run from the command line would look like:
tox -e all -- tests/test_write_read.py::TestWriteandReadData::test_vector_write
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you very much and congratulations to your first contribution 🎉
Closes #177