How to selectively run PyTest using Markers in PyCharm?

Hello PyCharm Team,

I have a bunch of test-cases in a folder /tests grouped using markers @pytest.mark,group1, @pytest.mark,group2, @pytest.mark,group3.

How do I pass the value of a marker such as group1 to execute all test-cases grouped with marker group1?

Kindly let me know if you need additional information

Regards,
SK

2
1 comment
Avatar
Permanently deleted user

Create a launcher of type Python tests > Py.test:

In the Configuration tab select Path and indicate the path to your script.

In Additional Arguments  put:

    -m "group1"

 

 

3

Please sign in to leave a comment.