Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
import six
collect_ignore = []

if six.PY3:
for fn in open('tests/py3-ignores.txt'):
if fn.strip():
collect_ignore.append(fn.strip())
collect_ignore = ["setup.py"]
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
doctest_optionflags = ALLOW_UNICODE ALLOW_BYTES
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ deps =
pytest
pytest-cov
commands =
py.test --cov=w3lib --cov-report= {posargs:w3lib tests}
py.test \
--doctest-modules \
--cov=w3lib --cov-report=term \
{posargs:w3lib tests}
2 changes: 1 addition & 1 deletion w3lib/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def html_to_unicode(content_type_header, html_body_str,

>>> import w3lib.encoding
>>> w3lib.encoding.html_to_unicode(None,
... """<!DOCTYPE html>
... b"""<!DOCTYPE html>
... <head>
... <meta charset="UTF-8" />
... <meta name="viewport" content="width=device-width" />
Expand Down
4 changes: 3 additions & 1 deletion w3lib/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def urljoin_rfc(base, ref, encoding='utf-8'):
.. warning::

This function is deprecated and will be removed in future.
It is not supported with Python 3.
Please use ``urlparse.urljoin`` instead.

Same as urlparse.urljoin but supports unicode values in base and ref
Expand All @@ -48,7 +49,8 @@ def urljoin_rfc(base, ref, encoding='utf-8'):
'http://www.example.com/otherpath/index2.html'
>>>

>>> w3lib.url.urljoin_rfc('http://www.example.com/path/index.html', u'fran\u00e7ais/d\u00e9part.htm')
>>> # Note: the following does not work in Python 3
>>> w3lib.url.urljoin_rfc(b'http://www.example.com/path/index.html', u'fran\u00e7ais/d\u00e9part.htm') # doctest: +SKIP
'http://www.example.com/path/fran\xc3\xa7ais/d\xc3\xa9part.htm'
>>>

Expand Down