Python debugger does not work while normal run does

Hi, 

I have looked at the similar questions that were asked here before, unfortunately, they did not help me.

when running my program it runs ok, 

but when debugging, nothing happens and it tries to run without debugging.

clicking on debug button shows the following lines in the console: 

 

~~~

C:\Python38\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 51520 --file C:/Users/tester/PycharmProjects/MatrixPro/TestFramework/main.py -t profaund_tests.export_logs
pydev debugger: process 8312 is connecting

Connected to pydev debugger (build 193.6494.30)
--------command = ['py.test', 'C:\\Users\\tester\\PycharmProjects\\MatrixPro\\TestFramework\\libs\\..\\tests\\profaund_tests\\export_logs.py', '-s', '-v', '--html=report.html', '--self-contained-html', '--capture=no', '-x']

Process finished with exit code -1

~~~

8 comments
Comment actions Permalink

Hi,

Could you share a screenshot of your run configuration?

0
Comment actions Permalink

Hi Sergey, yes sure, thanks for the quick reply.

 

0
Comment actions Permalink

Just one more clarification - when trying to debug, it does not stop on the breakpoints inside the tests.

thanks.

0
Comment actions Permalink

How do you run those tests from main.py?
Do you use os.system()?

0
Comment actions Permalink

Attached is the main.py file, 

I didn't write it, i need to figure the reason and fix it.

thanks

 

0
Comment actions Permalink

Would it be possible to share those main.py and export_logs.py (and other files if needed for execution) files so I can try it in my environment?
You can zip them and upload to our FTP server https://uploads.services.jetbrains.com/, just let me know the upload ID.

0
Comment actions Permalink

yes sir, I did, the id is: 2020_09_16_NXVg9UNNA2oceNFB

2 files, 1- main.py, 2- export logs

both include methods calling that are in different files but this is not relevant to the debugging issue.

I really appreciate your help.

thanks.

 

 

0
Comment actions Permalink

Thanks!

I was able to reproduce the issue with ignored breakpoints so I filed a bug https://youtrack.jetbrains.com/issue/PY-44538

Although it is strange that in your case the test file isn't even executed when debugging. I've had no luck in reproducing it.

Have you considered debugging your tests using the corresponding run configuration or calling tests from another file is the whole point here?

0

Please sign in to leave a comment.