Giter VIP home page Giter VIP logo

Comments (5)

jorisvandenbossche avatar jorisvandenbossche commented on June 1, 2024

It seems we also have a bunch of actual failures that might also be related to pytest 8? (I don't see much other potentially related packages that updated versions the last week)

from geopandas.

martinfleis avatar martinfleis commented on June 1, 2024

@m-richards can you point me to the report where this happens? From those few I clicked on, the failures and errors were on the very bottom as usual.

@jorisvandenbossche that was dev version of xyzservices broken by botched upstream PR in leaflet-provides. All green now.

from geopandas.

m-richards avatar m-richards commented on June 1, 2024

See https://github.com/geopandas/geopandas/actions/runs/7770406362/job/21190571888 for example - the errors are at the very bottom, but to see the error traceback you now have to scroll up through ~900 lines of xfailure tracebacks.

Maybe this is just something to get used to, but I found it super confusing at first to see all these keyerrors /attributeerrors in red but then realised they're all in the xfailed section

from geopandas.

martinfleis avatar martinfleis commented on June 1, 2024

Oh, the tracebacks. Yes, agree that we don't need this kind of verbosity for xfails.

from geopandas.

jorisvandenbossche avatar jorisvandenbossche commented on June 1, 2024

I don't fully understand how pytest intends this to be configured ..

An example test file where we have one xfailing test:

$ pytest geopandas/tests/test_op_output_types.py  -r fEx
================================== test session starts ================================================
platform linux -- Python 3.11.0, pytest-8.0.0, pluggy-1.4.0
rootdir: /home/joris/scipy/repos/geopandas
configfile: pyproject.toml
plugins: anyio-4.0.0
collected 33 items                                                                                                                                                                                                

geopandas/tests/test_op_output_types.py .....x...........................     
================================ 32 passed, 1 xfailed in 0.79s ========================================

With the default settings of only showing the "extra test summary" for failures and Errors (-r fE), the above doesn't actually list which tests are xfailing (it just says there was 1 xfailed test)

When enabling the test summary for xfailures as well:

$ pytest geopandas/tests/test_op_output_types.py  -r fEx
===================================== test session starts ======================================
platform linux -- Python 3.11.0, pytest-8.0.0, pluggy-1.4.0
rootdir: /home/joris/scipy/repos/geopandas
configfile: pyproject.toml
plugins: anyio-4.0.0
collected 33 items                                                                             

geopandas/tests/test_op_output_types.py .....x...........................                [100%]

========================================== XFAILURES ===========================================
____________________________________ test_loc_add_row[geom] ____________________________________

geom_name = 'geom'
nybb_filename = 'zip:///home/joris/scipy/repos/geopandas/geopandas/tests/data/nybb_16a.zip'

    @pytest.mark.parametrize(
        "geom_name",
        [
            "geometry",
            pytest.param(
                "geom",
                marks=pytest.mark.xfail(
                    reason="pre-regression behaviour only works for geometry col geometry"
                ),
            ),
        ],
    )
    def test_loc_add_row(geom_name, nybb_filename):
        # https://github.com/geopandas/geopandas/issues/3119
    
        nybb = geopandas.read_file(nybb_filename)[["BoroCode", "geometry"]]
        if geom_name != "geometry":
            nybb = nybb.rename_geometry(geom_name)
        # crs_orig = nybb.crs
    
        # add a new row
        nybb.loc[5] = [6, nybb.geometry.iloc[0]]
>       assert nybb.geometry.dtype == "geometry"
E       AssertionError: assert dtype('O') == 'geometry'
E        +  where dtype('O') = 0    MULTIPOLYGON (((970217.0223999023 145643.33221...\n1    MULTIPOLYGON (((1029606.0765991211 156073.8142...\n2    MUL...N (((1012821.8057861328 229228.2645...\n5    MULTIPOLYGON (((970217.0223999023 145643.33221...\nName: geom, dtype: object.dtype
E        +    where 0    MULTIPOLYGON (((970217.0223999023 145643.33221...\n1    MULTIPOLYGON (((1029606.0765991211 156073.8142...\n2    MUL...N (((1012821.8057861328 229228.2645...\n5    MULTIPOLYGON (((970217.0223999023 145643.33221...\nName: geom, dtype: object =    BoroCode                                               geom\n0         5  MULTIPOLYGON (((970217.0223999023 145643.3...    2  MULTIPOLYGON (((1012821.8057861328 229228.2645...\n5         6  MULTIPOLYGON (((970217.0223999023 145643.33221....geometry

geopandas/tests/test_op_output_types.py:170: AssertionError
=================================== short test summary info ====================================
XFAIL geopandas/tests/test_op_output_types.py::test_loc_add_row[geom] - pre-regression behaviour only works for geometry col geometry
================================ 32 passed, 1 xfailed in 0.86s =================================

The xfailed test is shown both in the verbose printing of xfailures (like a test failure, pointing to the assert line that is failing), and in the test summary.

I would personally like to keep the list of xfails in the short test summary (it gives them some visibility), but definitely don't want their verbose output. This is indeed way too verbose for something we know is happening, making it hard to check the verbose output of the actual tests.

Now, I don't see how I can get pytest to just show the short test summary for xfails. So then let's just disable xfails altogether for now, as it's more important to get rid of the verbosity.

from geopandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.