def test_quote_errors(self): self.assertRaises(TypeError, urlparse.quote, b'foo', encoding='utf-8') self.assertRaises(TypeError, urlparse.quote, b'foo', errors='strict')