- python -m pdb pdb_demo.py
- python -m pytest --pdb
- import pdb; pdb.set_trace()
- breakpoint()
- help
- next
- continue
- breakpoint
- up
- down
- jump
- conditions
- run python commands
- jump to python shell with local vars
| def printer(value): | |
| print(value.upper()) | |
| def looper(): | |
| vals = ['hello', 'world', 'and', 'ldp'] | |
| for val in vals: | |
| printer(val) | |
| def problem_child(): | |
| raise NotImplementedError | |
| if __name__ == '__main__': | |
| looper() | |
| variable = 7 # here to show scope | |
| problem_child() |
| from demo import * | |
| def tests_printer(): | |
| val = 'hello' | |
| result = printer(val) | |
| assert result == 'Hello' | |