Skip to content

Commit

Permalink
Fixed: doctests on Python 2 were not correctly checked.
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
mauritsvanrees committed Mar 26, 2019
1 parent c1e857e commit 8914b38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/7.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed: doctests on Python 2 were not correctly checked. [maurits]
2 changes: 1 addition & 1 deletion plone/indexer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ We have a compatibility alias in this package for use with CMF 2.1.
... indexed_value = getattr(object, idx)
... if callable(indexed_value):
... indexed_value = indexed_value()
... print(idx, "=", indexed_value)
... print("{0} = {1}".format(idx, indexed_value))
... except (AttributeError, TypeError,):
... pass

Expand Down
2 changes: 1 addition & 1 deletion plone/indexer/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def my_func(obj):
class Py23DocChecker(doctest.OutputChecker):
def check_output(self, want, got, optionflags):
if six.PY2:
got = re.sub("u'(.*?)'", "'\\1'", want)
got = re.sub("u'(.*?)'", "'\\1'", got)
return doctest.OutputChecker.check_output(self, want, got, optionflags)


Expand Down

0 comments on commit 8914b38

Please sign in to comment.