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

'tox -e pypy3' fails un the doctests phase #305

Closed
tseaver opened this issue May 27, 2024 · 5 comments
Closed

'tox -e pypy3' fails un the doctests phase #305

tseaver opened this issue May 27, 2024 · 5 comments
Assignees

Comments

@tseaver
Copy link
Member

tseaver commented May 27, 2024

$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
$ git log -p -1
commit 665380037d8875c0684acf5c5cfeceba07b8ef6c (HEAD -> master, origin/master, origin/HEAD)
Merge: 5a38cf6 90a4801
Author: Tres Seaver <tseaver@palladion.com>
Date:   Sun May 26 11:43:44 2024 -0400

    Merge pull request #304 from zopefoundation/tseaver-lint_squishing
    
    Get 'tox -e lint' woking again

$ tox -e pypy3
.pkg-pypy310: _optional_hooks> python /opt/Python-3.12.3/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
...
OK (skipped=12)
pypy3: commands[1]> sphinx-build -b doctest -d /home/tseaver/projects/Zope/Z3/zope.interface/.tox/pypy3/.cache/doctrees docs /home/tseaver/projects/Zope/Z3/zope.interface/.tox/pypy3/.cache/doctest
Running Sphinx v7.3.7
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
writing output... 
building [doctest]: targets for 18 source files that are out of date
updating environment: 0 added, 3 changed, 0 removed
reading sources... [100%] api/declarations
docstring of zope.interface.common.numbers.IReal.__trunc__:8: WARNING: Definition list ends without a blank line; unexpected unindent.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
running tests...

Document: README
----------------
1 items passed all tests:
 218 tests in default
218 tests in 1 items.
218 passed and 0 failed.
Test passed.

Document: adapter
-----------------
1 items passed all tests:
 164 tests in default
164 tests in 1 items.
164 passed and 0 failed.
Test passed.

Document: foodforthought
------------------------
1 items passed all tests:
  25 tests in default
25 tests in 1 items.
25 passed and 0 failed.
Test passed.

Document: human
---------------
1 items passed all tests:
  18 tests in default
18 tests in 1 items.
18 passed and 0 failed.
Test passed.

Document: verify
----------------
**********************************************************************
File "verify.rst", line 49, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo:
        Does not declaratively implement the interface
        The base.IBase.x attribute was not provided
        The module.IFoo.y attribute was not provided
Got:
    The object <builtins.Foo object at 0x00000000084a2138> has failed to implement interface module.IFoo:
        Does not declaratively implement the interface
        The base.IBase.x attribute was not provided
        The module.IFoo.y attribute was not provided
**********************************************************************
File "verify.rst", line 61, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: Does not declaratively implement the interface.
Got:
    The object <builtins.Foo object at 0x00000000084a2170> has failed to implement interface module.IFoo: Does not declaratively implement the interface.
**********************************************************************
File "verify.rst", line 125, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The module.IFoo.y attribute was not provided.
Got:
    The object <builtins.Foo object at 0x0000000006695168> has failed to implement interface module.IFoo: The module.IFoo.y attribute was not provided.
**********************************************************************
File "verify.rst", line 131, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The base.IBase.x attribute was not provided.
Got:
    The object <builtins.Foo object at 0x0000000006695558> has failed to implement interface module.IFoo: The base.IBase.x attribute was not provided.
**********************************************************************
File "verify.rst", line 142, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo ...> has failed to implement interface ...IFoo:
        The base.IBase.x attribute was not provided
        The module.IFoo.y attribute was not provided
Got:
    The object <builtins.Foo object at 0x0000000006695600> has failed to implement interface module.IFoo:
        The base.IBase.x attribute was not provided
        The module.IFoo.y attribute was not provided
**********************************************************************
File "verify.rst", line 161, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The module.IFoo.x attribute was not provided.
Got:
    The object <builtins.Foo object at 0x00000000066959f0> has failed to implement interface module.IFoo: The module.IFoo.x attribute was not provided.
**********************************************************************
File "verify.rst", line 209, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The module.IFoo.simple(arg1) attribute was not provided.
Got:
    The object <builtins.Foo object at 0x0000000006695b78> has failed to implement interface module.IFoo: The module.IFoo.simple(arg1) attribute was not provided.
**********************************************************************
File "verify.rst", line 219, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The contract of module.IFoo.simple(arg1) is violated because '42' is not a method.
Got:
    The object <builtins.Foo object at 0x0000000006695ef8> has failed to implement interface module.IFoo: The contract of module.IFoo.simple(arg1) is violated because '42' is not a method.
**********************************************************************
File "verify.rst", line 228, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The contract of module.IFoo.simple(arg1) is violated because '<lambda>()' doesn't allow enough arguments.
Got:
    The object <builtins.Foo object at 0x00000000057ccbb8> has failed to implement interface module.IFoo: The contract of module.IFoo.simple(arg1) is violated because '<lambda>()' doesn't allow enough arguments.
**********************************************************************
File "verify.rst", line 236, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The contract of module.IFoo.simple(arg1) is violated because '<lambda>(a, b)' requires too many arguments.
Got:
    The object <builtins.Foo object at 0x00000000057cd440> has failed to implement interface module.IFoo: The contract of module.IFoo.simple(arg1) is violated because '<lambda>(a, b)' requires too many arguments.
**********************************************************************
File "verify.rst", line 263, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The contract of module.IFoo.needs_kwargs(**kwargs) is violated because 'Foo.needs_kwargs(a=1, b=2)' doesn't support keyword arguments.
Got:
    The object <builtins.Foo object at 0x00000000057cd520> has failed to implement interface module.IFoo: The contract of module.IFoo.needs_kwargs(**kwargs) is violated because 'Foo.needs_kwargs(a=1, b=2)' doesn't support keyword arguments.
**********************************************************************
File "verify.rst", line 273, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo: The contract of module.IFoo.needs_varargs(*args) is violated because 'Foo.needs_varargs(**kwargs)' doesn't support variable arguments.
Got:
    The object <builtins.Foo object at 0x00000000057cd5c8> has failed to implement interface module.IFoo: The contract of module.IFoo.needs_varargs(*args) is violated because 'Foo.needs_varargs(**kwargs)' doesn't support variable arguments.
**********************************************************************
File "verify.rst", line 294, in default
Failed example:
    verify_foo()
Expected:
    The object <Foo...> has failed to implement interface ...IFoo:
        The contract of base.IBase.method(arg1) is violated because 'Base.method()' doesn't allow enough arguments
        The module.IFoo.x attribute was not provided
Got:
    The object <builtins.Foo object at 0x00000000057cd6e0> has failed to implement interface module.IFoo:
        The contract of base.IBase.method(arg1) is violated because 'Base.method()' doesn't allow enough arguments
        The module.IFoo.x attribute was not provided
**********************************************************************
1 items had failures:
  13 of  78 in default
78 tests in 1 items.
65 passed and 13 failed.
***Test Failed*** 13 failures.

Document: api/declarations
--------------------------
1 items passed all tests:
 302 tests in default
302 tests in 1 items.
302 passed and 0 failed.
Test passed.

Document: api/specifications
----------------------------
1 items passed all tests:
 109 tests in default
109 tests in 1 items.
109 passed and 0 failed.
Test passed.

Doctest summary
===============
  914 tests
   13 failures in tests
    0 failures in setup code
    0 failures in cleanup code
build finished with problems, 1 warning.
pypy3: exit 1 (10.51 seconds) /home/tseaver/projects/Zope/Z3/zope.interface> sphinx-build -b doctest -d /home/tseaver/projects/Zope/Z3/zope.interface/.tox/pypy3/.cache/doctrees docs /home/tseaver/projects/Zope/Z3/zope.interface/.tox/pypy3/.cache/doctest pid=304314
  pypy3: FAIL code 1 (26.86=setup[4.73]+cmd[11.62,10.51] seconds)
  evaluation failed :( (26.99 seconds)

Quelle surprise? A doctest fails because of some object's __repr__ produces different output on different versions / implementations of Python?

We don't see this on GHA because GHA sensibly doesn't run the doctests in every possible environment, but only with the docs themselves.

@tseaver tseaver self-assigned this May 27, 2024
@tseaver
Copy link
Member Author

tseaver commented May 27, 2024

/me sings, a la Polly Purebred, "Oh where, oh where is my renormalize fu. / Oh where, oh where can he be?:

@davisagli
Copy link
Member

The challenge here is that the RENormalizing support is in zope.testing (https://github.com/zopefoundation/zope.testing/blob/master/src/zope/testing/renormalizing.py) but these tests are run by a sphinx extension https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html

@tseaver
Copy link
Member Author

tseaver commented May 27, 2024

@davisagli Thanks, I got just about far enough to see that before I gave up.

My inclination would be to bracket the __repr__-failing doctest snippets with # doctest: SKIP and just get on with why I originally came to the party :)

@davisagli
Copy link
Member

davisagli commented May 27, 2024 via email

@davisagli
Copy link
Member

Fixed in #308

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

2 participants