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:

from unittest import TestCase
class TestMyApp(TestCase):
    def test_mytest1(self):
        ...
    def test_mytest2(self):
        ...
prettyPrint();
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
3 comments
Hi Dmitriy,

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 .
0
Tried it, didn't help.  
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

import socket
from unittest import TestCase

class TestSanbox(TestCase):
    def test_test1(self):
        print 1
        pass

    def test_test2(self):
        ip = "0.0.0.0"
        port = 53

        # reserve ip:port
        udp_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        udp_sock.bind((ip, port))

prettyPrint();

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
0
Hm, I've started new project with that example and it did work in 129.258 as expected.
but I still see the issue with my production code.  I'll try to find a better example.
0

Please sign in to leave a comment.