jenkins-bot has submitted this change and it was merged.
Change subject: Remove dependency on doctest-ignore-unicode
......................................................................
Remove dependency on doctest-ignore-unicode
doctest-ignore-unicode is used to ignore u'..' prefixes
in the doctest output.
When it isnt installed, doctest complains with an uninformative
error:
ValueError: line 34 of the doctest for api.Request has an invalid
option: u'+IGNORE_UNICODE'
Instead of using doctest-ignore-unicode, downgrade the values to
a `str` to remove the u'..' prefix on Python 2.
Change-Id: I4471a3eb658a98970b49dd5e3d71e1d5e195d0e6
---
M pywikibot/data/api.py
M tox.ini
2 files changed, 14 insertions(+), 16 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 53e6132..8ce923b 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1301,24 +1301,24 @@
>> # add a new parameter
>> r['siprop'] = "namespaces"
>> # note that "uiprop" param gets added automatically
-
>>> r.action # doctest: +IGNORE_UNICODE
- u'query'
- >>> sorted(r._params.keys()) # doctest: +IGNORE_UNICODE
- [u'action', u'meta', u'siprop']
- >>> r._params['action'] # doctest: +IGNORE_UNICODE
- [u'query']
- >>> r._params['meta'] # doctest: +IGNORE_UNICODE
- [u'userinfo', u'siteinfo']
- >>> r._params['siprop'] # doctest: +IGNORE_UNICODE
- [u'namespaces']
- >>> data = r.submit() # doctest: +IGNORE_UNICODE
+ >>> str(r.action)
+ 'query'
+ >>> sorted(str(key) for key in r._params.keys())
+ ['action', 'meta', 'siprop']
+ >>> [str(key) for key in r._params['action']]
+ ['query']
+ >>> [str(key) for key in r._params['meta']]
+ ['userinfo', 'siteinfo']
+ >>> [str(key) for key in r._params['siprop']]
+ ['namespaces']
+ >>> data = r.submit()
>> isinstance(data, dict)
True
>> set(['query', 'batchcomplete',
'warnings']).issuperset(data.keys())
True
>> 'query' in data
True
- >>> sorted(data[u'query'].keys()) # doctest: +IGNORE_UNICODE
+ >>> sorted(str(key) for key in data[u'query'].keys())
['namespaces', 'userinfo']
"""
diff --git a/tox.ini b/tox.ini
index ba8f743..834d66d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -208,10 +208,9 @@
commands =
python -W error::UserWarning -m generate_user_files -family:test -lang:test -v
nosetests --version
- nosetests --with-doctest --with-doctest-ignore-unicode -v -a "!net" tests
pywikibot {[params]nose_skip}
+ nosetests --with-doctest -v -a "!net" tests pywikibot {[params]nose_skip}
deps =
nose
- doctest-ignore-unicode
unicodecsv
[testenv:nose34]
@@ -219,10 +218,9 @@
commands =
python -W error::UserWarning -m generate_user_files -family:test -lang:test -v
nosetests --version
- nosetests --with-doctest --with-doctest-ignore-unicode -v -a "!net" tests
pywikibot {[params]nose_skip}
+ nosetests --with-doctest -v -a "!net" tests pywikibot {[params]nose_skip}
deps =
nose
- doctest-ignore-unicode
six
[testenv:venv]
--
To view, visit
https://gerrit.wikimedia.org/r/242398
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4471a3eb658a98970b49dd5e3d71e1d5e195d0e6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>