Reputation: 1070
In Pytest we have the pytest --markers
command which will list all of the markers that are available for use.
However, I am not seeing a command to list tests associated with x marker. The documentation didn't appear to cover this so is this a possibility in Pytest?
Upvotes: 6
Views: 4616
Reputation: 150
A more cleaner output can be achieved by using:
(spark_pytest) ALIPL0958:Spark_pytest kapilmathur$ pytest -m integration --collect-only -qq
tests/Servers/test_server_rebuild.py::TestRebuildWithVolumes::test_rebuild_with_volume_attached
tests/Servers/test_server_rebuild.py::TestRebuildWithVolumes::test_post_rebuild_with_second_volume_attach
tests/Servers/test_server_resize.py::TestResizeWithVolumes::test_resize_with_volume_attached
tests/Servers/test_server_resize.py::TestResizeWithVolumes::test_post_resize_with_second_volume_attach
Upvotes: 3
Reputation: 6105
Use --collect-only
in conjuction with -m <marker>
:
$ py.test --collect-only -m x
=========================== test session starts ===========================
platform linux -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: /home/they4kman/.virtualenvs/tmp-e1f1b42d6ff9bfa/src, inifile:
collected 3 items
<Module 'test_markers.py'>
<Function 'test_x'>
====================== no tests ran in 0.00 seconds =======================
Upvotes: 11