SoCo 프로젝트에는 첫 번째 실행에서만 pypy에서 하나의 테스트가 실패하는 작은 테스트 스위트가 있습니다 (pyc 파일이없는 경우). 후속 작업이 성공합니다. pypy에서 유니 코드를 pypy에서 비교하면 첫 번째 실행시 오류가 발생합니다.
처음 테스트를 실행하는, 실패한 테스트의 출력은 "는 다르게 항목"의 양쪽이 완전히 동일하다고E assert {'CurrentLEDS...': 'μИⅠℂ☺ΔЄ'} == {'CurrentLEDSt...: 'μИⅠℂ☺ΔЄ'}
E Common items:
E {'CurrentLEDState': 'On'}
E Differing items:
E {'Unicode': 'μИⅠℂ☺ΔЄ'} != {'Unicode': 'μИⅠℂ☺ΔЄ'}
주이다. 테스트를 실행하면 unittest/__pycache__/test_services.pypy-20-PYTEST.pyc
파일이 생성됩니다. 파일을 그대로두고 테스트를 실행하면 성공합니다. pyc 파일을 삭제하고 테스트를 다시 실행하면 실패합니다.
실패한 테스트
는mkdir soco-tmp
cd soco-tmp/
git clone https://github.com/SoCo/SoCo.git
cd SoCo/
git reset --hard 4d6cea18d30e5b30ed5c6f #that's the current revision when writing this
virtualenv -p `which pypy` venv
source venv/bin/activate
python --version
# Python 2.7.3 (2.2.1+dfsg-1~ppa1, Nov 28 2013, 02:02:56)
# [PyPy 2.2.1 with GCC 4.6.3]
pip install -r requirements.txt -r requirements-dev.txt
pip install .
py.test unittest/test_services.py # should fail
py.test unittest/test_services.py # should succeed
rm unittest/__pycache__/*
python -B -mpytest unittest/test_services.py # will always fail as no pyc is created
이 PyPy 버그 것 같아 (당신이 pypy 설치 한 가정)하지만, OTOH 내가 지금까지 간단한 테스트 케이스에 재현 할 수 재현 할 수 있습니다 ..
아이디어가 있으십니까?
첫 번째 힌트 : 오류 메시지는'{... \ u0404 \ U0001f48b '}! = {... \ u0404 \ ud83d \ udc8b'}'로 끝납니다. 유니 코드 문자열은 실제로 다릅니다. 두 번째 문자열은 한 문자 대신 두 개의 대리 문자를 사용합니다. –