Use xfail to ignore test failure on TimeoutError
#!/usr/bin/python
# coding: utf8
+import pytest
+from requests.packages.urllib3.exceptions import TimeoutError
import geocoder
@@ -123,6 +125,7 @@ def test_maxmind():
assert g.ok
+@pytest.mark.xfail(raises=TimeoutError)
def test_baidu():
g = geocoder.baidu(china)
assert g.ok
@@ -269,12 +272,14 @@ def test_geocodefarm_reverse():
assert g.ok
+@pytest.mark.xfail(raises=TimeoutError)
def test_uscensus():
g = geocoder.uscensus(' '.join([us_address, us_city, us_state, us_zipcode]))
assert g.ok
assert g.city == us_city.upper()
+@pytest.mark.xfail(raises=TimeoutError)
def test_uscensus_reverse():
g = geocoder.uscensus((38.904722, -77.016389), method='reverse')
assert g.ok
