Can't run Temporary Run/Debug Configurations (Ctrl+Shift+F10) one method anymore
In PyCharm 129.19 Ctrl+Shift+F10 can't run only one test method. Here's what I do:
Click on test_mytest1, press Ctrl+Shift+F10. Temp configuration is created for the script, i.e. it runs both tests.
I remember older PyCharm versions were able to create "method" configs automatically.
Is it a bug in PyCharm or I do something wrong? If latter I'd appreciate some help.
Integrated tools / Default Test Runner: Unittests
from unittest import TestCase class TestMyApp(TestCase): def test_mytest1(self): ... def test_mytest2(self): ...
Click on test_mytest1, press Ctrl+Shift+F10. Temp configuration is created for the script, i.e. it runs both tests.
I remember older PyCharm versions were able to create "method" configs automatically.
Is it a bug in PyCharm or I do something wrong? If latter I'd appreciate some help.
Integrated tools / Default Test Runner: Unittests
请先登录再写评论。
in the first place, PyCharm tries to find already created configuration for the file.
Please, try to remove created temporary Run configurations for this file and repeat Ctrl+Shift+F10 .
I've spent some time playing with it. I've reproduced the problem with simple example, seems to fail due to the error in the 2nd test, but why the 2nd test is being run if I'm trying asking to run only the 1st?
Set cursor at the end of "def test_test1(self):" line, click Ctrl+Shift+F10
Left window:
!Test Results
temp_sandbox.TestSanbox
test_test2
Right Window:
C:\work\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 125.45\helpers\pycharm\utrunner.py" temp_sandbox.py true
Testing started at 4:00 PM ...
1
Error
Traceback (most recent call last):
File "C:/work/temp_sandbox.py", line 14, in test_test2
udp_sock.bind((ip, port))
File "C:\work\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
Process finished with exit code 0
but I still see the issue with my production code. I'll try to find a better example.