Skip to content

Instantly share code, notes, and snippets.

View kentavv's full-sized avatar

Kent VanderVelden kentavv

View GitHub Profile
@kentavv
kentavv / python_debugger.py
Last active March 19, 2019 13:51
Invoking python debugger on exception
import pdb
try:
1/0
except Exception:
# Just say "no" to endless debug-prints
pdb.post_mortem()
#<stdin>(2)<module>()
#(Pdb) h
import pytest
@pytest.fixture(autouse=True, scope="function")
def temporary_working_directory(tmp_path_factory):
"""
Create (and chdir into) a temporary working directory using
PyTest facilities for the specified scope. After testing scope
is complete, original working directory is restored and temporary
working directory is removed. This fixture could be listed as