pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

4.0.0: Q about `assertpy` used in test suite

Open kloczek opened this issue 2 years ago • 3 comments

Just started upgrade my rpm package to 4..0.0 and notices that it uses now assertpy

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-html-4.0.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-html-4.0.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.18, pytest-7.4.0, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-html-4.0.0
configfile: tox.ini
testpaths: testing
plugins: html-4.0.0
collected 0 items / 3 errors

========================================================================================== ERRORS ===========================================================================================
___________________________________________________________________________ ERROR collecting testing/test_e2e.py ____________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pytest-html-4.0.0/testing/test_e2e.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
testing/test_e2e.py:8: in <module>
    from assertpy import assert_that
E   ModuleNotFoundError: No module named 'assertpy'
_______________________________________________________________________ ERROR collecting testing/test_integration.py ________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pytest-html-4.0.0/testing/test_integration.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
testing/test_integration.py:12: in <module>
    from assertpy import assert_that
E   ModuleNotFoundError: No module named 'assertpy'
___________________________________________________________________________ ERROR collecting testing/test_unit.py ___________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pytest-html-4.0.0/testing/test_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
testing/test_unit.py:7: in <module>
    from assertpy import assert_that
E   ModuleNotFoundError: No module named 'assertpy'
===================================================================================== warnings summary ======================================================================================
testing/test_unit.py:5
  /home/tkloczko/rpmbuild/BUILD/pytest-html-4.0.0/testing/test_unit.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
  /usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
  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
================================================================================== short test summary info ==================================================================================
ERROR testing/test_e2e.py
ERROR testing/test_integration.py
ERROR testing/test_unit.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================================================== 4 warnings, 3 errors in 0.26s ===============================================================================

which seems had no new version since 2020 https://github.com/assertpy/assertpy/tags

If I'm trying to use correct assertpy does it make sense to use module which is not well maintained? 🤔

kloczek avatar Sep 01 '23 19:09 kloczek

I have no idea about the status of it. I use it with great success in many projects both OS and professionally.

Once that type of library reaches maturity, you're not going to see very active work being done. Because what would that work entail?

With that said, I'm happy to discuss alternatives.

BeyondEvil avatar Sep 01 '23 19:09 BeyondEvil

I'm not familiar about details of API which this module offers 😋 however on building its documentation I've noticed that it uses veeery old ``sphinxcontrib.napoleon which should be replaces by some modern module (sphinxcontrib.napoleon` was part os sphinx 3.x/4.x).

What about standard pytest assertions? 🤔 https://docs.pytest.org/en/7.1.x/how-to/assert.html

kloczek avatar Sep 01 '23 20:09 kloczek

What about standard pytest assertions? 🤔 https://docs.pytest.org/en/7.1.x/how-to/assert.html

It's not nearly as rich as assertpy unfortunately.

Noticed that the author of assertpy hasn't made a single contribution to a single github project during 2023. This is obviously a bad sign. :(

BeyondEvil avatar Sep 01 '23 20:09 BeyondEvil