Pycharm debugger not working in subprocess which calls behave


I have a pycharm module which calls the behave command via os.execvp.  When I set breakpoints in the behave files, they don't trigger.  However when I run behave through pycharm, the breakpoints hit.  I am aware of how specific this issue is, but I'm at a loss of what to try.  My coworker has the same setup as me, and executes it fine.




Comment actions Permalink

Hi Adam,

Try starting PyCharm with default settings by renaming/removing configuration and plugins folders

Has it helped?

Comment actions Permalink

If not, please clarify if you have files named in your project?

Comment actions Permalink

I renamed my .PyCharm2019 directory, created a new project and venv from scratch, installed a new copy of behave in that venv, and still having same issue.  There are definitely more than a few modules named in other PycharmProjects, but none in this project or venv.

Comment actions Permalink

Could you provide a code sample and steps for reproducing?

Comment actions Permalink
  1. Create new project named 'sample'
  2. Create new venv - python 2.7
  3. Install the 'behave' package in venv
  4. Create a directory in sample project named 'src' and mark as 'Source' directory.
  5. Create the the following directory structure under 'src' (* denotes a directory)
  6. Set a breakpoint in file
  7. Run the runIt module in Debug Mode as a regular python file (which calls behave via execvp).





Attached to this are the, tutorial.feature, and files to place in the above directories.  The is blank

Comment actions Permalink

Looks like I can only upload images.  Here's the text contained in each file


import os

if __name__ == '__main__':
    os.execvp('PycharmProjects/sample/venv/bin/behave', ['PycharmProjects/sample/src/behave_practice/features/tutorial.feature', '--tags', 'tutor'])



Feature: showing off behave

    Scenario: run a simple test
        Given we have behave installed
        When we implement a test
        Then behave will test it for us!



from behave import given, when, then

@given('we have behave installed')
def step_impl(context):
    print "behave installed"

@when('we implement a test')
def step_impl(context):
    assert True is not False

@then('behave will test it for us!')
def step_impl(context):
    assert context.failed is False

Comment actions Permalink

Oh, I see now.

Thank you very much for providing the steps for reproducing! It helped a lot.

Here is a bug report in our tracker, please vote for it and follow for updates.


Please sign in to leave a comment.