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

Tests failing dues to incorrect escaping of RE strings #3325

Closed
mcepl opened this issue Oct 6, 2018 · 10 comments
Closed

Tests failing dues to incorrect escaping of RE strings #3325

mcepl opened this issue Oct 6, 2018 · 10 comments
Assignees
Labels
bug Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ outdated

Comments

@mcepl
Copy link

mcepl commented Oct 6, 2018

Long story short

[   53s] platform linux -- Python 3.6.5, pytest-3.8.1, py-1.5.4, pluggy-0.7.1
[   53s] rootdir: /home/abuild/rpmbuild/BUILD/aiohttp-3.4.4, inifile: setup.cfg
[   53s] plugins: timeout-1.3.2, mock-1.10.0
...
build/rpmbuild/BUILD/aiohttp-3.4.4/aiohttp/_http_writer.cpython-36m-x86_64-linux-gnu.so
[   70s] ============================= test session starts ==============================
[   70s] platform linux -- Python 3.6.5, pytest-3.8.1, py-1.5.4, pluggy-0.7.1
[   70s] rootdir: /home/abuild/rpmbuild/BUILD/aiohttp-3.4.4, inifile: setup.cfg
[   70s] plugins: timeout-1.3.2, mock-1.10.0
[   77s] collected 1910 items / 4 errors
[   77s] 
[   77s] ==================================== ERRORS ====================================
[   77s] __________________ ERROR collecting tests/test_http_parser.py __________________
[   77s] /usr/lib/python3.6/site-packages/_pytest/python.py:482: in _importtestmodule
[   77s]     mod = self.fspath.pyimport(ensuresyspath=importmode)
[   77s] /usr/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
[   77s]     __import__(modname)
[   77s] E     File "/home/abuild/rpmbuild/BUILD/aiohttp-3.4.4/tests/test_http_parser.py", line 372
[   77s] E       match = ("400, message='Got more than 8190 bytes \({}\) when reading"
[   77s] E               ^
[   77s] E   SyntaxError: invalid escape sequence \(
[   77s] ____________________ ERROR collecting tests/test_streams.py ____________________
[   77s] /usr/lib/python3.6/site-packages/_pytest/python.py:482: in _importtestmodule
[   77s]     mod = self.fspath.pyimport(ensuresyspath=importmode)
[   77s] /usr/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
[   77s]     __import__(modname)
[   77s] E     File "/home/abuild/rpmbuild/BUILD/aiohttp-3.4.4/tests/test_streams.py", line 724
[   77s] E       assert re.search("<StreamReader w=<Future pending[\S ]*>>",
[   77s] E                       ^
[   77s] E   SyntaxError: invalid escape sequence \S
[   77s] __________________ ERROR collecting tests/test_urldispatch.py __________________
[   77s] /usr/lib/python3.6/site-packages/_pytest/python.py:482: in _importtestmodule
[   77s]     mod = self.fspath.pyimport(ensuresyspath=importmode)
[   77s] /usr/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
[   77s]     __import__(modname)
[   77s] E     File "/home/abuild/rpmbuild/BUILD/aiohttp-3.4.4/tests/test_urldispatch.py", line 589
[   77s] E       route = router.add_route('GET', '/get/{num:^\d+}', handler,
[   77s] E                                      ^
[   77s] E   SyntaxError: invalid escape sequence \d
[   77s] __________________ ERROR collecting tests/test_web_request.py __________________
[   77s] /usr/lib/python3.6/site-packages/_pytest/python.py:482: in _importtestmodule
[   77s]     mod = self.fspath.pyimport(ensuresyspath=importmode)
[   77s] /usr/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
[   77s]     __import__(modname)
[   77s] E     File "/home/abuild/rpmbuild/BUILD/aiohttp-3.4.4/tests/test_web_request.py", line 343
[   77s] E       header = 'BY=identifier;pROTO="\lala lan\d\~ 123\!&"'
[   77s] E               ^
[   77s] E   SyntaxError: invalid escape sequence \l
[   77s] !!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!
[   77s] =========================== 4 error in 7.42 seconds ============================
[   78s] error: Bad exit status from /var/tmp/rpm-tmp.2YgiWK (%check)
[   78s] 
[   78s] 
[   78s] RPM build errors:
[   78s]     Bad exit status from /var/tmp/rpm-tmp.2YgiWK (%check)
[   78s] 
[   78s] stitny failed "build python-aiohttp.spec" at Sat Oct  6 08:56:18 UTC 2018.
[   78s] 

Expected behaviour

Test suite should pass without problems.

Actual behaviour

It fails as shown above

Steps to reproduce

Just run testsuite with python3 setup.py test

Your environment

[  124s] platform linux -- Python 3.6.5, pytest-3.8.1, py-1.5.4, pluggy-0.7.1

chroot build environment for openSUSE, details at SPEC file and full build log.

This patch fixes the issue.

@aio-libs-bot
Copy link

GitMate.io thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are #2148 (Failed tests), #2280 (Test fails on ppc64le), #2726 (Failing tests without network connection), #13 (allowed_methods fail due to traling whitespace), and #494 (Tests fail with pep8-1.6).

@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2018

@mcepl could you please send that as a PR?

@webknjaz webknjaz added the Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ label Oct 6, 2018
@mcepl
Copy link
Author

mcepl commented Oct 6, 2018

@webknjaz I have couple of hundred packages to manage (plus I dabble in almost thousand more) as a openSUSE packager. Do I have to clone all of them, just because its upstream maintainers are too lazy to apply a patch file themselves?

@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2018

I was just worrying that the patch wouldn't be credited to you. And please don't accuse ppl you don't know in anything, which is a lie basically. Most of maintainers here are also busy with even higher-volume projects. I can easily count your rudeness as laziness following your example.

@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2018

At least post your github email, so that we could use Co-authored-by: in commit message. Please.

@mcepl
Copy link
Author

mcepl commented Oct 6, 2018

At least post your github email, so that we could use Co-authored-by: in commit message. Please.

You are right, I have overreacted. I am sorry. It is mcepl at cepl dot eu. The name is Matěj Cepl

@gyermolenko
Copy link
Contributor

@asvetlov has already fixed it with f3a94ce
It is in master (and not available in latest 3.4.4 release)

@webknjaz
Copy link
Member

webknjaz commented Oct 8, 2018

@gyermolenko raw-strings way is better, though. I'd apply the patch. Maybe partially.

@asvetlov
Copy link
Member

The problem is fixed.
I see no activity in providing a more aesthetic patch.
Closing.

@lock
Copy link

lock bot commented Jan 14, 2020

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Jan 14, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ outdated
Projects
None yet
Development

No branches or pull requests

5 participants