Use pytest markers to categorize and selectively run tests
Preconditions (2)
Step 1: Create three test functions: test_login, test_logout, test_profile
Step 2: Add a marker 'smoke' to test_login and test_logout
Step 3: Add a marker 'regression' to test_profile
Step 4: Run pytest with the option to only run tests marked 'smoke'
Step 5: Observe that only test_login and test_logout run
Step 6: Run pytest with the option to skip tests marked 'smoke'
Step 7: Observe that only test_profile runs
✅ Expected Result: Tests run according to the markers specified in the pytest command line options