gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
557 stars 102 forks source link

Podman tests marked as xfail #532

Open LewisGaul opened 9 months ago

LewisGaul commented 9 months ago

A bunch of tests are marked as xfail for podman to indicate that either there's a missing functionality in python-on-whales or just in the test. Any tests that do not apply to podman (e.g. docker swarm tests) should not be parameterised with podman. This issue tracks issues relating to resolving all the podman xfails.

If you add this to the pytest_collection_modifyitems() hook in conftest.py then only xfail tests are run, combined with passing the pytest arg --runxfail it's easy to see the state of xfail tests.

    # Deselect all items that are not marked with 'xfail'
    remaining_items = []
    for item in items:
        if item.get_closest_marker("xfail"):
            remaining_items.append(item)
    items[:] = remaining_items