Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py23DocChecker makes test always pass on Python 2 #7

Closed
mauritsvanrees opened this issue Mar 26, 2019 · 2 comments
Closed

Py23DocChecker makes test always pass on Python 2 #7

mauritsvanrees opened this issue Mar 26, 2019 · 2 comments

Comments

@mauritsvanrees
Copy link
Member

The Py23DocChecker doctest compatibility class has a typo which basically sets got = want which means the doctests always pass on Python 2.

@mauritsvanrees
Copy link
Member Author

To check, simply edit README.rst and add a test like this:

    >>> print('Should give doctest failure')
    Nah!

This passes on Python 2... :-)

@mauritsvanrees
Copy link
Member Author

For the record, after disabling the got = want line, these are the failures:

Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
    1/2 (50.0%)

Failure in test /Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst
Failed doctest test for README.rst
  File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 0

----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 11, in README.rst
Failed example:
    print('Should give doctest failure')
Expected:
    Nah!
Got:
    Should give doctest failure
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 84, in README.rst
Failed example:
    page_description(test_page)()
Expected:
    'My page wi'
Got:
    u'My page wi'
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 202, in README.rst
Failed example:
    catalog.catalog_object(page, 'p1', idxs=['description', 'audience', 'length'])
Expected:
    description = The page b
    length = 23
Got:
    ('description', '=', u'The page b')
    ('length', '=', 23)
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 206, in README.rst
Failed example:
    catalog.catalog_object(news, 'n1', idxs=['description', 'audience', 'length'])
Expected:
    description = News summary
    audience = AUDIENCE
Got:
    ('description', '=', u'News summary')
    ('audience', '=', u'AUDIENCE')
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 223, in README.rst
Failed example:
    catalog.catalog_object(news, 'n1', idxs=['description', 'audience', 'review_state'])
Expected:
    description = News summary
    audience = AUDIENCE
    review_state = published
Got:
    ('description', '=', u'News summary')
    ('audience', '=', u'AUDIENCE')
    ('review_state', '=', 'published')
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 230, in README.rst
Failed example:
    catalog.catalog_object(page, 'p3', idxs=['description', 'text'])
Expected:
    description = The page b
    text = The page body text here
Got:
    ('description', '=', u'The page b')
    ('text', '=', u'The page body text here')
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 258, in README.rst
Failed example:
    catalog.catalog_object(news, 'n1', idxs=['description', 'audience', 'length'])
Expected:
    description = News summary
    audience = AUDIENCE
Got:
    ('description', '=', u'News summary')
    ('audience', '=', u'AUDIENCE')
----------------------------------------------------------------------
File "/Users/maurits/community/plone-coredev/5.2/src/plone.indexer/plone/indexer/README.rst", line 264, in README.rst
Failed example:
    catalog2.catalog_object(news, 'n1', idxs=['description', 'audience', 'length'])
Expected:
    description = News summary
    audience = audience
Got:
    ('description', '=', u'News summary')
    ('audience', '=', u'audience')

                
  Ran 2 tests with 1 failures, 0 errors, 0 skipped in 0.022 seconds.

mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Mar 26, 2019
Branch: refs/heads/master
Date: 2019-03-26T19:44:50+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.indexer@8914b38

Fixed: doctests on Python 2 were not correctly checked.

Fixes plone/plone.indexer#7

Files changed:
A news/7.bugfix
M plone/indexer/README.rst
M plone/indexer/tests.py
Repository: plone.indexer

Branch: refs/heads/master
Date: 2019-03-27T00:51:08+01:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.indexer@3d9036e

Merge pull request #8 from plone/maurits-issue-7-py23docchecker

Fixed: doctests on Python 2 were not correctly checked.

Files changed:
A news/7.bugfix
M plone/indexer/README.rst
M plone/indexer/tests.py
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Mar 26, 2019
Branch: refs/heads/master
Date: 2019-03-26T19:44:50+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.indexer@8914b38

Fixed: doctests on Python 2 were not correctly checked.

Fixes plone/plone.indexer#7

Files changed:
A news/7.bugfix
M plone/indexer/README.rst
M plone/indexer/tests.py
Repository: plone.indexer

Branch: refs/heads/master
Date: 2019-03-27T00:51:08+01:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.indexer@3d9036e

Merge pull request #8 from plone/maurits-issue-7-py23docchecker

Fixed: doctests on Python 2 were not correctly checked.

Files changed:
A news/7.bugfix
M plone/indexer/README.rst
M plone/indexer/tests.py
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Mar 26, 2019
Branch: refs/heads/master
Date: 2019-03-26T19:44:50+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.indexer@8914b38

Fixed: doctests on Python 2 were not correctly checked.

Fixes plone/plone.indexer#7

Files changed:
A news/7.bugfix
M plone/indexer/README.rst
M plone/indexer/tests.py
Repository: plone.indexer

Branch: refs/heads/master
Date: 2019-03-27T00:51:08+01:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.indexer@3d9036e

Merge pull request #8 from plone/maurits-issue-7-py23docchecker

Fixed: doctests on Python 2 were not correctly checked.

Files changed:
A news/7.bugfix
M plone/indexer/README.rst
M plone/indexer/tests.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant