PIO unit tests tries to access wrong serial port

Haven’t found a solution yet.
According to this Post, upload_port has no effect when upload_protocol = stlink. Now I am wondering if test_port has any effect.
That still wouldn’t explain why PIOs “default choice” is wrong, though.