Skip to content

pytest configuration broken with pytest 8.x; failures in Build & Test CI #37536

@mkoeppe

Description

@mkoeppe

https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:25

Run # We run tests with "sage -t --new"; this only tests the uncommitted changes.
no stored timings available
Running doctests with ID 2024-03-03-00-51-03-d46e69e[8](https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:9).
Running with SAGE_LOCAL='/sage/local' and SAGE_VENV='/sage/local/var/lib/sage/venv-python3.11.1'
Using --optional=bliss,coxeter3,debian,mcqd,meataxe,pip,sage,sage_spkg,sirocco,tdlib
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,cvxopt,cvxopt,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_cubic_hecke,database_ellcurves,database_graphs,database_jones_numfield,database_knotinfo,dvipng,fpylll,fricas,gap_package_atlasrep,gap_package_design,gap_package_grape,gap_package_guava,gap_package_hap,gap_package_polycyclic,gap_package_qpa,gap_package_quagroup,gfan,graphviz,imagemagick,ipython,jmol,jupymake,kenzo,latte_int,lrcalc_python,lrslib,matroid_database,mcqd,meataxe,mpmath,msolve,nauty,networkx,numpy,palp,pandoc,pdf2svg,pdftocairo,pexpect,phitigra,pillow,plantri,polytopes_db,polytopes_db_4d,pplpy,primecountpy,ptyprocess,pynormaliz,pyparsing,python_igraph,requests,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.libs.braiding,sage.libs.ecl,sage.libs.flint,sage.libs.gap,sage.libs.linbox,sage.libs.m4ri,sage.libs.ntl,sage.libs.pari,sage.libs.singular,sage.misc.cython,sage.modular,sage.modules,sage.numerical.mip,sage.plot,sage.rings.complex_double,sage.rings.finite_rings,sage.rings.function_field,sage.rings.number_field,sage.rings.padics,sage.rings.polynomial.pbori,sage.rings.real_double,sage.rings.real_mpfr,sage.sat,sage.schemes,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,scipy,singular,sphinx,symengine_py,sympy,tdlib,threejs
Doctesting files changed since last git commit
No files to doctest
Features detected for doctesting: 
Running pytest on ['/sage/src'] with options []
============================= test session starts ==============================
platform linux -- Python 3.11.1, pytest-8.0.2, pluggy-1.3.0
rootdir: /sage/src
configfile: tox.ini
plugins: hypothesis-6.[9](https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:10)8.15, mock-3.12.0, anyio-4.0.0
collected 63 items / 2 skipped

src/conftest_test.py .F                                                  [  3%]
src/sage/doctest/parsing_test.py ...........                             [ 20%]
src/sage/manifolds/differentiable/examples/symplectic_space_test.py .... [ 26%]
                                                                         [ 26%]
src/sage/manifolds/differentiable/symplectic_form_test.py .............. [ 49%]
.....................                                                    [ 82%]
src/sage/manifolds/differentiable/tensorfield_paral_test.py .            [ 84%]
src/sage/numerical/backends/cvxopt_backend_test.py ..                    [ 87%]
src/sage/numerical/backends/glpk_backend_test.py ..                      [ 90%]
src/sage/numerical/backends/glpk_exact_backend_test.py ..                [ 93%]
src/sage/numerical/backends/interactivelp_backend_test.py ..             [ 96%]
src/sage/numerical/backends/ppl_backend_test.py ..                       [[10](https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:11)0%]

=================================== FAILURES ===================================
______________ TestPytestSageScript.test_invoke_on_inputtest_file ______________

self = <conftest_test.TestPytestSageScript object at 0x7fdb71d51f90>

    def test_invoke_on_inputtest_file(self):
        result = subprocess.run(
            ["sage", "--pytest", input_file],
            capture_output=True,
            text=True,
        )
>       assert result.returncode == 1  # There are failures in the input test
E       AssertionError: assert 2 == 1
E        +  where 2 = CompletedProcess(args=['sage', '--pytest', PosixPath('/sage/src/conftest_inputtest.py')], returncode=2, stdout='======...n !!!!!!!!!!!!!!!!!!!!\n=============================== 1 error in 0.[22](https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:23)s ===============================\n', stderr='').returncode

src/conftest_test.py:[40](https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:41): AssertionError
=========================== short test summary info ============================
FAILED src/conftest_test.py::TestPytestSageScript::test_invoke_on_inputtest_file - AssertionError: assert 2 == 1
 +  where 2 = CompletedProcess(args=['sage', '--pytest', PosixPath('/sage/src/conftest_inputtest.py')], returncode=2, stdout='======...n !!!!!!!!!!!!!!!!!!!!\n=============================== 1 error in 0.22s ===============================\n', stderr='').returncode
============= 1 failed, 62 passed, 2 skipped in 102.79s (0:01:[42](https://github.com/sagemath/sage/actions/runs/8126496765/job/22210315057?pr=37401#step:14:43)) ==============
Error: Process completed with exit code 1.

On closer look, our pytest integration is completely broken.

./sage -pytest                                                                                                                                                     git:sage_geometry_modularization
======================================================================================================== test session starts ========================================================================================================
platform darwin -- Python 3.12.3, pytest-8.2.1, pluggy-1.5.0
rootdir: /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src
configfile: tox.ini
plugins: anyio-4.0.0
collected 63 items / 2465 errors / 2 skipped                                                                                                                                                                                        

============================================================================================================== ERRORS ===============================================================================================================
___________________________________________________________________________________________________ ERROR collecting conftest.py ____________________________________________________________________________________________________
src/conftest.py:81: in collect
    module = self.config.pluginmanager._importconftest(
E   TypeError: PytestPluginManager._importconftest() missing 1 required keyword-only argument: 'consider_namespace_packages'
______________________________________________________________________________________________ ERROR collecting conftest_inputtest.py _______________________________________________________________________________________________
src/conftest.py:88: in collect
    module = import_path(
E   TypeError: import_path() missing 1 required keyword-only argument: 'consider_namespace_packages'
_________________________________________________________________________________________________ ERROR collecting conftest_test.py _________________________________________________________________________________________________

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions