Update test_threshold.py

Fixes #1140