MAINT: use assert_warns instead of a more complicated mechanism
MAINT: copypaste assert_warns from a newer numpy into scipy
MAINT: move a numpy compatibility function into its own file
MAINT: python 3 compatibility boilerplate
MAINT: small changes to address PR comments
PEP8: remove line continuation backslash
Merge pull request #3407 from argriffing/use-assert-warns

MAINT: use assert_warns instead of a more complicated mechanism
TST: fix test errors due to deprecations in numpy 1.9.0

Due to deprecation of boolean array subtraction and indexing
with multiple ellipsis.
TST: fix a test failure in stats.mstats reported in gh-3554.

The ``mstats.trim`` test is still failing; looks like a regression in numpy
master.
TST: reduce test tolerance for LSMR test by 1 decimal.  See gh-3554.

Reported failing with numpy master by several people.
TST: avoid using nans in stats.mstats tests.

Nans may trigger RuntimeWarnings from numpy (not consistent on
all platforms), which lead to test failures with dev versions of numpy.