Fix false negative responses from python tests

Closes #2298