Skip to content

Instantly share code, notes, and snippets.

@rich-hart
Last active August 29, 2015 14:18
Show Gist options
  • Save rich-hart/ac55c42e28c3b33520df to your computer and use it in GitHub Desktop.
Save rich-hart/ac55c42e28c3b33520df to your computer and use it in GitHub Desktop.
Python debugger startup script. Place both test.sh and .pdbrc files in the root path of you python project. In this case it would the be cnx-authoring dir.
# Add cnx directories to sys.path so the debugger can start up with breakpoints inside of modules.
import sys
sys.path.append('/Users/openstax/workspace/openstax_scripts/development/cnx-authoring')
sys.path.append('/Users/openstax/workspace/openstax_scripts/development/cnx-authoring/cnxauthoring/tests')
sys.path.append('/Users/openstax/workspace/openstax_scripts/development/cnx-authoring/cnxauthoring')
b utils:404
b views:421
#!/bin/bash
# run chmod 755 test.sh first.
# by default debugger always places a break point in the first line at the first module it encounters.
# In this case it would be setup.py
../bin/python -m pdb setup.py test -s cnxauthoring.tests.test_functional.FunctionalTests.test_delete_content_w_publish_error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment