Enhancement of Matplotlib import with nosetests

Hi,

I made this patch because I can't run the tests for archlinux packages (I'm the packager for lmfit). The problem is that archlinux uses nosetests2 or nosetests3, and it is not detected by endswith().

Also, this was checked twice in the test. I do not see a good reason for that.