Skip to content

Instantly share code, notes, and snippets.

@ssanderson
Created June 15, 2016 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssanderson/3ec388a62c8e721c9fd1d6f6c3b7e7d7 to your computer and use it in GitHub Desktop.
Save ssanderson/3ec388a62c8e721c9fd1d6f6c3b7e7d7 to your computer and use it in GitHub Desktop.
Machete-mode debugging, ala https://www.youtube.com/watch?v=bAcfPzxB3dk.
# td is a TemporaryDirectory that's being deleted earlier than
# expected somewhere in my test suite.
import shutil
old_rmtree = shutil.rmtree
def rmtree(path, *args, **kwargs):
if path == td.name:
import nose.tools; nose.tools.set_trace()
return old_rmtree(path, *args, **kwargs)
shutil.rmtree = rmtree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment