Fix false negative responses from python tests

Closes #2298
Merge pull request #2343 from strk/2.3.x-false-negatives

Fix false negative responses from python tests