
Skip or deselect a test in pytest
Use pytest skip and skipif markers, distinguish expected failures from skipped tests, and temporarily exclude a test by its node ID.
Focused answers for definitions, architecture choices, troubleshooting, pricing, and evaluation.

Use pytest skip and skipif markers, distinguish expected failures from skipped tests, and temporarily exclude a test by its node ID.

Set requests and urllib3 logger thresholds, understand inherited levels and propagation, and keep useful HTTP warnings visible without hiding application exceptions.

Separate suppressing log records from hiding pytest output, restore logging state after tests, and keep caplog assertions meaningful.

Control access logs in Flask, Django, Uvicorn, and Gunicorn while retaining the error records you need to investigate failures.

Restore tracked files from the index while keeping staged edits, preview untracked cleanup, or stash changes you may want to recover later.

Use git archive to export a commit or subdirectory as ZIP or tar, apply export-ignore rules, and avoid packaging the wrong working-tree contents.

Use partial clone with sparse checkout to work with one directory, or extract it from an archive when you do not need Git history.

Set client_max_body_size for the right endpoint, allow multipart overhead, and test Nginx and application limits together.

Use subprocess.run to pass arguments, capture output, check failures, set timeouts, and redirect command output without unnecessary shell parsing.

Leave an activated Python environment, reactivate it on your platform, and check which interpreter a terminal or process is actually using.

Use os.path.splitext or pathlib suffix properties to handle ordinary extensions, dotfiles, and compound filenames without fragile string searches.

Fetch remote-tracking branches from one or more remotes, fix a single-branch refspec, and understand what --all and --prune actually update.