How to use wildcard in command prompt while executing the pytest test cases

Viewed 2094

I have below project structure in Pycharm.

Project Folder: PythonTutorial

Package: pytestpackage

Python Files: test_conftest_demo1.py, test_conftest_demo2.py

I'm trying to run the above 2 python files having almost similar name using pytest from command prompt with the below command. But I'm facing the below issue. Please help me on the same.

Note: I'm using windows 10 operating system .

Command Used: py.test -s -v test_conftest_demo*.py

enter image description here

1 Answers

use the -k option to specify substring matching.

$ pytest -s -v -k "test_conftest_demo"
Related