Pycharm debugger not working in subprocess which calls behave
Answered
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.
Thanks,
Adam
Please sign in to leave a comment.
Hi Adam,
Try starting PyCharm with default settings by renaming/removing configuration and plugins folders https://www.jetbrains.com/help/pycharm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html
Has it helped?
If not, please clarify if you have files named server.py in your project?
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 server.py in other PycharmProjects, but none in this project or venv.
Could you provide a code sample and steps for reproducing?
PycharmProjects/sample/src/:
behave_practice*
PycharmProjects/sample/src/behave_practice:
features* __init__.py runIt.py
PycharmProjects/sample/src/behave_practice/features:
tutorial.feature
PycharmProjects/sample/src/behave_practice/features/steps:
tutorial.py
Attached to this are the tutorial.py, tutorial.feature, and runIt.py files to place in the above directories. The __init__.py is blank
Looks like I can only upload images. Here's the text contained in each file
-------------src/behave_practice/runIt.py-------------
import os
if __name__ == '__main__':
os.execvp('PycharmProjects/sample/venv/bin/behave', ['PycharmProjects/sample/src/behave_practice/features/tutorial.feature', '--tags', 'tutor'])
-------------src/behave_practice/features/tutorial.feature-------------
Feature: showing off behave
@tutor
Scenario: run a simple test
Given we have behave installed
When we implement a test
Then behave will test it for us!
-------------src/behave_practice/features/steps/tutorial.py-------------
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
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 https://youtrack.jetbrains.com/issue/PY-37760, please vote for it and follow for updates.