jazzband / django-nose

Django test runner using nose
http://pypi.python.org/pypi/django-nose
BSD 3-Clause "New" or "Revised" License
882 stars 234 forks source link

Debugging in Pycharm with django-nose not working #281

Open flyudvik opened 7 years ago

flyudvik commented 7 years ago

I can not run debugger in Pycharm with default configuration. test runner just ignores breakpoints.

Django==1.10.6
coverage==4.3.4
nose==1.3.7
django-nose==1.4.4

I'm using following configuration

NOSE_ARGS = [
    '--with-coverage',
    '--cover-package=foo,bar',
    '--detailed-errors',
    '-s'
]

Added -s option by following answer on this question on stackoverflow

What am I doing wrong?

aliva commented 6 years ago

It seems pycharm has some kind if conflict with --with-coverage option, commenting that line fixed the problem for me

nirgilboa commented 4 years ago

Ran into this, adding my solution:

import sys
RUNNING_WITH_DEBUGGER = True if sys.gettrace() is not None else False

NOSE_ARGS = [
    '--with-xunit',
    '--xunit-file=nosetests.xml',
]

if not RUNNING_WITH_DEBUGGER:
    NOSE_ARGS.extend([
        '--cover-erase',
        '--with-xcoverage',
        '--xcoverage-file=coverage.xml',
        '--cover-package=testDjangoApp',
    ])