Py.test freezes after waiting for expected exception

I have a very simple test function that looks like this:

def test_timeout_connect():
    with pytest.raises(minus_one_rpc.TimeoutExpired):
        c = minus_one_rpc.Client("tcp://localhost:14247", recv_timeout = 100)

Without pytest.raises(...), I get a test FAILEDwith the expected exception. However, when I try to check for the correct exception, py.test hangs in this test.

No fixtures are involved in this particular test, but it looks like it has something to do with the break, because when I press Ctrl-C, the test reports like SUCCESS!

test_minus_one_rpc.py::test_timeout_connect ^CPASSED

================================================== 27 tests deselected ==================================================
======================================== 1 passed, 27 deselected in 3.02 seconds ========================================

What could be the reason?

+4
source share
1 answer

Answer: calling the destructor that is hanging.

, / , exc_info , .

( pyzmq , LINGER, pyzmq , .)

+1

Source: https://habr.com/ru/post/1676533/


All Articles