Closed woxcab closed 8 years ago
It is strange. If I run in python 2.7.10 with beautifulsoup 3.2.1
from pyquery import PyQuery as pq
d = pq('<meta><head><title>Hello</head><body onload=crash()>Hi all<p>', parser='soup')
assert str(d) == '<html><meta/><head><title>Hello</title></head><body onload="crash()">Hi all<p/></body></html>'
then I don't get any AssertionError, but Travis got it.
Travis use 2.7.9
Same problem was in the previous build: https://travis-ci.org/gawel/pyquery/builds/83374284
right... and nothing related to this test in the previous commit... let say your PR is ok, thanks
@gawel, Is it possibly better to replace condition resp.status_code != 200
to 200 <= resp.status_code < 300
like same situation processing in the urllib (both in python 2.* and python 3.*)? Because all codes 2XX have success sense: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success .
done
I offer raise the exception if the HTTP code is not equal to 200 because this warns about an unexpected content.