diff --git a/tests/test_requests.py b/tests/test_requests.py index 76df752a..14e76576 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -23,8 +23,7 @@ from requests.auth import HTTPBasicAuth, HTTPDigestAuth -if (sys.platform == 'win32') and ('HTTPBIN_URL' not in os.environ): - os.environ['HTTPBIN_URL'] = 'http://httpbin.org/' +os.environ['HTTPBIN_URL'] = 'http://httpbin.org/' # TODO: Detect an open port. PORT = os.environ.get('HTTPBIN_PORT', '7077') @@ -813,6 +812,18 @@ class RequestsTestSuite(TestSetup, unittest.TestCase): r = requests.get(httpbin('post'), auth=('a', 'b'), data='\xff') + def test_useful_exception_for_invalid_schema(self): + + try: + self.assertRaises( + requests.exceptions.URLRequired, + get, + 'http://http://') + # To make this test as minimal as possible, only catch the + # exception raised in issue #380. + except ValueError: + self.fail() + if __name__ == '__main__':