Run tests with pytest

Stop at first failure, verbose, short traceback

pytest -x -v --tb=short tests/

tool
python15 commands
tags
pythondebug

More python commands

  • python3 -m py_compile script.py && echo OK

    Compile to bytecode only to catch syntax errors

  • black --check --diff . && black .

    Preview changes then apply Black formatting

  • ruff check . --fix

    Fast linter + auto-fix (replaces flake8, isort, pyupgrade)

  • mypy --strict --ignore-missing-imports src/

    Strict static type checking for a package

  • python3 -c "import json; print([x for x in dir(json) if not x.startswith('_')])"

    List public attributes of any Python object

all 15 python commands