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 failures with PyPy3.9 #333

Closed
mgorny opened this issue May 21, 2022 · 2 comments · Fixed by #358
Closed

Test failures with PyPy3.9 #333

mgorny opened this issue May 21, 2022 · 2 comments · Fixed by #358

Comments

@mgorny
Copy link

mgorny commented May 21, 2022

With PyPy3.9 7.3.9, the following tests are failing:

Tests running...
======================================================================
FAIL: testtools.tests.test_testresult.TestNonAsciiResults.test_syntax_error
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testtools/testtools/tests/test_testresult.py", line 2678, in test_syntax_error
    self.assertIn(self._as_output(
  File "/tmp/testtools/testtools/testcase.py", line 399, in assertIn
    self.assertThat(haystack, Contains(needle), message)
  File "/tmp/testtools/testtools/testcase.py", line 480, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: '  File "<string>", line 1\n    f(a, b c)\n           ^\nSyntaxError: ' not in 'Tests running...\n======================================================================\nERROR: test_syntax_error.Test.runTest\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File "/tmp/TestNonAsciiResultsdm0yfepy/test_syntax_error.py", line 6, in runTest\n    exec (\'f(a, b c)\')\n  File "<string>", line 1\n    f(a, b c)\n         ^\nSyntaxError: invalid syntax. Perhaps you forgot a comma?\n\nRan 1 test in 0.001s\nFAILED (failures=1)\n'
======================================================================
FAIL: testtools.tests.test_testresult.TestNonAsciiResultsWithUnittest.test_syntax_error
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testtools/testtools/tests/test_testresult.py", line 2678, in test_syntax_error
    self.assertIn(self._as_output(
  File "/tmp/testtools/testtools/testcase.py", line 399, in assertIn
    self.assertThat(haystack, Contains(needle), message)
  File "/tmp/testtools/testtools/testcase.py", line 480, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: '  File "<string>", line 1\n    f(a, b c)\n           ^\nSyntaxError: ' not in 'E\n======================================================================\nERROR: runTest (test_syntax_error.Test)\ntest_syntax_error.Test.runTest\n----------------------------------------------------------------------\ntesttools.testresult.real._StringException: Traceback (most recent call last):\n  File "/tmp/TestNonAsciiResultsWithUnittestzy0f2shc/test_syntax_error.py", line 6, in runTest\n    exec (\'f(a, b c)\')\n  File "<string>", line 1\n    f(a, b c)\n         ^\nSyntaxError: invalid syntax. Perhaps you forgot a comma?\n\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n'

Ran 2627 tests in 2.930s
FAILED (failures=2)
@ddormer
Copy link

ddormer commented Feb 2, 2023

This is due to 2 additional spaces being added in-between f(a, b c)\n and ^\nSyntaxError: . I suppose the tests should have another if-branch testing for the PyPy versions that contain more spaces?

I can confirm this happens in PyPy3.9-7.3.10 as well, however I don't have easy access to older versions on my M1 Mac.

@cclauss
Copy link
Contributor

cclauss commented Oct 16, 2023

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.

3 participants