gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
537 stars 100 forks source link

Make the test_cpus() testcase non-strict xfail for podman #597

Closed LewisGaul closed 2 months ago

LewisGaul commented 2 months ago

It works on cgroups v2 or rootful:

$python -m pytest tests/python_on_whales/components/test_container.py -k cpus -v
============================================================== test session starts ==============================================================
platform linux -- Python 3.8.19, pytest-7.4.4, pluggy-1.5.0 -- /home/legaul/repos/python-on-whales/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/legaul/repos/python-on-whales
configfile: pyproject.toml
plugins: mock-3.14.0
collected 223 items / 221 deselected / 2 selected

tests/python_on_whales/components/test_container.py::test_cpus[docker] PASSED                                                             [ 50%]
tests/python_on_whales/components/test_container.py::test_cpus[podman] XPASS (Cgroup control not available with rootless podman on cg...) [100%]

================================================= 1 passed, 221 deselected, 1 xpassed in 2.31s ==================================================