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

Doctests broken with zope.schema 4.7 #21

Closed
jamadden opened this issue Sep 21, 2018 · 0 comments
Closed

Doctests broken with zope.schema 4.7 #21

jamadden opened this issue Sep 21, 2018 · 0 comments
Assignees

Comments

@jamadden
Copy link
Member

One must run tox -e docs to catch this, though, it's not normally tested with a simple run of zope-testrunner.

Document: api/fields
--------------------
**********************************************************************
File "api/fields.rst", line 120, in default
Failed example:
    gg.fromUnicode('Foo')
Expected:
    Traceback (most recent call last):
    ...
    WrongType: ('An interface is required', ...
Got:
    Traceback (most recent call last):
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest default[5]>", line 1, in <module>
        gg.fromUnicode('Foo')
      File "//zope.configuration/.tox/docs/lib/python2.7/site-packages/zope/configuration/fields.py", line 77, in fromUnicode
        self.validate(value)
      File "//zope.configuration/.tox/docs/lib/python2.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
        self._validate(value)
      File "//zope.configuration/.tox/docs/lib/python2.7/site-packages/zope/configuration/fields.py", line 63, in _validate
        self.value_type.validate(value)
      File "//zope.configuration/.tox/docs/lib/python2.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
        self._validate(value)
      File "//zope.configuration/.tox/docs/lib/python2.7/site-packages/zope/schema/_field.py", line 638, in _validate
        ).with_field_and_value(self, value)
    NotAnInterface: (<class 'Foo'>, <InterfaceClass zope.interface.interfaces.IInterface>, '')
**********************************************************************
@jamadden jamadden self-assigned this Sep 22, 2018
jamadden added a commit that referenced this issue Sep 22, 2018
Fixes #21

Include them as part of the normal test run (using manuel, because
plain doctest doesn't accept absolute paths).

Switch Sphinx to run them under Python 3. We can use a checker as part
of the normal test run, but not under Sphinx, so normalize the output
for Python 3.
jamadden added a commit that referenced this issue Sep 22, 2018
Fixes #21

Include them as part of the normal test run (using manuel, because
plain doctest doesn't accept absolute paths).

Switch Sphinx to run them under Python 3. We can use a checker as part
of the normal test run, but not under Sphinx, so normalize the output
for Python 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant