TST: added test for issue #3017.

Also changed style to please numpy developers.