Remove hard requirement for py.test by vendorizing assertRaises