Fixes test to assert instead of print

This commit fixes a test added as part of #3575, which was done to fix #1713.