Comments (10)
It appears you are running the test suite with pytest. Instead, run it like this: python -m twisted.trial klein
or tox -e py38
. Feel free to re-open if the issue persists when the tests are run that way.
from klein.
Well, something has changed since I added the 21.8.0 release to our Gentoo tree. I am now getting this same test fail error on my system (gcc/glibc based) using both pytest and twisted.trial.
Could this be a change in one of the dependencies causing this?
===============================================================================
[ERROR]
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/klein/test/test_resource.py", line 642, in test_addSlash
request.setHeader.assert_has_calls(
File "/usr/lib/python3.8/unittest/mock.py", line 950, in assert_has_calls
raise AssertionError(
builtins.AssertionError: Calls not found.
Expected: [call(b'Content-Type', b'text/html; charset=utf-8'),
call(b'Content-Length', b'258'),
call(b'Location', b'http://localhost:8080/foo/')]
Actual: [call(b'Content-Type', b'text/html; charset=utf-8'),
call(b'Content-Length', b'239'),
call(b'Location', b'http://localhost:8080/foo/')]
klein.test.test_resource.KleinResourceTests.test_addSlash
Ran 242 tests in 126.510s
FAILED (errors=1, successes=241)
- ERROR: dev-python/klein-21.8.0-r1::gentoo failed (test phase):
Installed Dependencies:
storm /etc/portage # emerge -va1 --jobs=1 klein attrs hyperlink incremental tubes twisted werkzeug zope-interface hypothesis treq
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] dev-python/zope-interface-5.4.0-r2::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/attrs-22.1.0::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/hyperlink-21.0.0-r1::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/incremental-21.3.0-r1::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/werkzeug-2.2.2::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/hypothesis-6.54.4::gentoo USE="cli -test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/twisted-22.4.0-r2::gentoo USE="http2 ssl -conch -serial -test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -pypy3 -python3_11" 0 KiB
[ebuild R ] dev-python/tubes-0.2.1::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10 -python3_11" 0 KiB
[ebuild R ] dev-python/treq-22.2.0-r1::gentoo USE="-doc -test" PYTHON_TARGETS="python3_8 python3_9 python3_10" 0 KiB
[ebuild R ] dev-python/klein-21.8.0-r1::gentoo USE="-test" PYTHON_TARGETS="python3_8 python3_9 python3_10" 0 KiB
Total: 10 packages (10 reinstalls), Size of downloads: 0 KiB
Would you like to merge these packages? [Yes/No] n
from klein.
Also, github is not letting me re-open this bug!
from klein.
Can one of the repo admins please re-open this issue for me?
from klein.
I just ran the test suite on the installed klein pkg and am getting the same failure. So it is not a network-sandbox issue with our emerge process.
from klein.
I just re-ran tests for all those pkgs that had tests enabled in their ebuilds, plus a few of their deps, and all passed except for klein again.
from klein.
On NixOS with Python 3.8.13 and 3.10.5 I tried to reproduce with:
pip install zope-interface==5.4.0 attrs==22.1.0 hyperlink==21.0.0 incremental==21.3.0 werkzeug==2.2.2 hypothesis==6.54.4 twisted==22.4.0 tubes==0.2.1 treq==22.2.0 klein==21.8.0
pip install -e klein-checkout
python -m twisted.trial klein
but I wasn't able to. :/
from klein.
However, with Klein 21.8.0 I did reproduce the failure.
from klein.
It looks like this was fixed in bce8b85 (merged in 4041169 for #552).
So all that's needed now is a release.
The fix was a test-only fix, for what it's worth (the assertion about the exact content length is no longer made).
from klein.
This was included in 23.5.0
from klein.
Related Issues (20)
- hyperlink generates invalid URLs via hypothesis which sometimes causes our tests to fail HOT 6
- Death to you garbage mainstream propaganda slaves
- Twisted fools, hope you have a tragic life and painful death.
- AttributeError: module 'OpenSSL.SSL' has no attribute 'TLS_METHOD' HOT 2
- Fix CI
- Klein does not work with Werkzeug 2.3
- Python 3.11 support
- Why "405 Method Not Allowed" ? HOT 3
- ReadTheDocs is showing old version of docs HOT 2
- release instructions as written do not actually issue a prerelease
- (maybe) put hypothesis back HOT 4
- the merge queue needs help from our status checks to actually work
- tox 4 usually hangs when I run tests locally HOT 1
- Returning a static file from a route that matches all URLs behaves unexpectedly
- Accessing the `installSignalHandlers` parameter of the `reactor.run()` method HOT 1
- Any way to do send_file like Flask HOT 1
- update to mypy 1.7 HOT 1
- spin release infrastructure out to a separate project
- version update, release, and push happen in the wrong order in release infrastructure HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from klein.