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

PyPy3.9 fails twisted.trial._dist.test.test_workertrial tests: twisted.trial.unittest.FailTest: 'rb' is not 'rb' #10302

Closed
twisted-trac opened this issue Feb 1, 2022 · 2 comments

Comments

@twisted-trac
Copy link

mgorny's avatar @mgorny reported
Trac ID trac#10302
Type defect
Created 2022-02-01 23:20:57Z

4 twisted.trial._dist.test.test_workertrial tests fail because of issues resembling the following:

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/mgorny/twisted/.venv/lib/pypy3.9/site-packages/twisted/trial/_dist/test/test_workertrial.py", line 126, in test_readInterrupted
    main(self.fdopen)
  File "/home/mgorny/twisted/.venv/lib/pypy3.9/site-packages/twisted/trial/_dist/workertrial.py", line 75, in main
    protocolIn = _fdopen(_WORKER_AMP_STDIN, "rb")
  File "/home/mgorny/twisted/.venv/lib/pypy3.9/site-packages/twisted/trial/_dist/test/test_workertrial.py", line 72, in fdopen
    self.assertIdentical("rb", mode)
  File "/home/mgorny/twisted/.venv/lib/pypy3.9/site-packages/twisted/trial/_synctest.py", line 439, in assertIs
    raise self.failureException(msg or f"{first!r} is not {second!r}")
twisted.trial.unittest.FailTest: 'rb' is not 'rb'

twisted.trial._dist.test.test_workertrial.MainTests.test_readInterrupted
-------------------------------------------------------------------------------

The cause seems to be that .assertIdentical() is used to perform the test rather than .assertEqual(). It seems that comparing two strings for equality happens to work on CPython (though it causes a SyntaxWarning) but does not on PyPy.

Searchable metadata
trac-id__10302 10302
type__defect defect
reporter__mgorny mgorny
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__trial trial
keywords__None None
time__1643757657468265 1643757657468265
changetime__1644040913732691 1644040913732691
version__None None
owner__None None

@twisted-trac
Copy link
Author

mgorny's avatar @mgorny commented

#1691

@twisted-trac
Copy link
Author

twm's avatar @twm set status to closed

Thank you for the patch! Merged in b9777eb

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