2 tests failed on PyPy 2.4 & 2.5
Open
Nobody has claimed this yet.
bug
installation
low priority
- Dominant language
- Python
- Stars
- 459
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
Migrated issue, originally created by desiderius (@desiderius)
The following tests case failed on PyPy 2.4 & 2.5:
- FAIL: test_file_success (test.test_cmd.CmdTest)
- FAIL: test_stdin_success (test.test_cmd.CmdTest)
Traceback:
======================================================================
FAIL: test_file_success (test.test_cmd.CmdTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/nix-build-pypy2.5-Mako-1.0.1.drv-0/Mako-1.0.1/test/test_cmd.py", line 48, in test_file_success
eq_(stdout.write.mock_calls[0][1][0], "hello world 5")
File "/tmp/nix-build-pypy2.5-Mako-1.0.1.drv-0/Mako-1.0.1/test/__init__.py", line 64, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: ' ' != 'hello world 5'
======================================================================
FAIL: test_stdin_success (test.test_cmd.CmdTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/nix-build-pypy2.5-Mako-1.0.1.drv-0/Mako-1.0.1/test/test_cmd.py", line 19, in test_stdin_success
eq_(stdout.write.mock_calls[0][1][0], "hello world 5")
File "/tmp/nix-build-pypy2.5-Mako-1.0.1.drv-0/Mako-1.0.1/test/__init__.py", line 64, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: ' ' != 'hello world 5'
----------------------------------------------------------------------
A quick glance in the debugger between a successful test in CPython and PyPy 2.4 shows that in:
eq_(stdout.write.mock_calls[0][1][0], "hello world 5")
the first call refers to a whitespace in PyPy 2.4:
[call(' '), call(u'hello world 5'), call('\n'), call.__str__(), call.__str__()]
but not in CPython:
[call(u'hello world 5'), call('\n'), call.__str__(), call.__str__()]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with test/test_cmd.py and run test_file_success and test_stdin_success under PyPy 2.4 and 2.5, comparing the stdout.write mock calls with CPython. Trace the extra whitespace write and determine the change needed so both tests pass on the affected PyPy versions while retaining the expected "hello world 5" output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100