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

Test regression with pypy3.9: test_overload_on_compiled_functions #83

Closed
mgorny opened this issue Oct 7, 2022 · 3 comments · Fixed by #84
Closed

Test regression with pypy3.9: test_overload_on_compiled_functions #83

mgorny opened this issue Oct 7, 2022 · 3 comments · Fixed by #84

Comments

@mgorny
Copy link

mgorny commented Oct 7, 2022

$ pypy3 --version
Python 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Sep 05 2022, 05:41:51)
[PyPy 7.3.9 with GCC 12.2.1 20220903]
$ tox -e pypy3
pypy3 inst-nodeps: /tmp/typing_extensions/.tox/.tmp/package/1/typing_extensions-4.4.0.tar.gz
pypy3 installed: cffi==1.15.0,greenlet==0.4.13,hpy==0.0.3,readline==6.2.4.1,typing_extensions @ file:///tmp/typing_extensions/.tox/.tmp/package/1/typing_extensions-4.4.0.tar.gz
pypy3 run-test-pre: PYTHONHASHSEED='150667971'
pypy3 run-test: commands[0] | python -m unittest discover
..................s...........................................................................................s.s..s...............................F.................................................Runtime type is 'object'
......................................................s.........
======================================================================
FAIL: test_overload_on_compiled_functions (test_typing_extensions.OverloadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pypy3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/tmp/typing_extensions/src/test_typing_extensions.py", line 526, in test_overload_on_compiled_functions
    self.assertEqual(get_overloads(sum), [])
AssertionError: Lists differ: [<built-in function sum>] != []

First list contains 1 additional elements.
First extra element 0:
<built-in function sum>

- [<built-in function sum>]
+ []

----------------------------------------------------------------------
Ran 261 tests in 0.253s

FAILED (failures=1, skipped=5)
ERROR: InvocationError for command /tmp/typing_extensions/.tox/pypy3/bin/python -m unittest discover (exited with code 1)
_______________________________________________________________ summary _______________________________________________________________
ERROR:   pypy3: commands failed
srittau added a commit to srittau/typing_extensions that referenced this issue Oct 7, 2022
@srittau
Copy link
Collaborator

srittau commented Oct 7, 2022

One preliminary note: As the implementation of overload matches the implementation of overload in Python 3.11, pypy would also fail with the typing.py module from there.

@srittau
Copy link
Collaborator

srittau commented Oct 7, 2022

The problem is that sum() and print() are not compiled functions in pypy. The test in question checks whether @overload is skipped for those, so it can't work. #84 just skips this tests when running pypy.

@mgorny
Copy link
Author

mgorny commented Oct 7, 2022

Thanks. This makes sense to me.

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

Successfully merging a pull request may close this issue.

2 participants