Closed kloczek closed 2 years ago
But test run by Tox passed correctly
test_delete_cookie fails on Debian on Python 3.9.1 and Bottle 0.12.19 as well.
That's just a broken test. It was fixed, but not back-portet to 0.12.
Just tested 1.2.19 and it still fails
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nInternal Server Error\n \n \n' ____________________________________________________________ TestOutputFilter.test_error_in_generator_callback _____________________________________________________________ self =
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nUnhandled exception\n \n \n' ________________________________________________________________________ TestSendFile.test_download ________________________________________________________________________ self =
Looks like pytest is failing as well
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nUnhandled exception\n \n \n' _______________________________________________________________________ TestOutputFilter.test_error ________________________________________________________________________ self =
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nInternal Server Error\n \n \n' ________________________________________________________________________ TestMakoTemplate.test_file ________________________________________________________________________ self =
Just tested -0.12.19 and pytest still fails
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nInternal Server Error\n \n \n' ____________________________________________________________ TestOutputFilter.test_error_in_generator_callback _____________________________________________________________ self =
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nUnhandled exception\n \n \n' ________________________________________________________________________ TestSendFile.test_download ________________________________________________________________________ self =
Just retested 0.12.21 + patch
--- a/test/test_environ.py 2022-06-09 10:50:08.693817701 +0300
+++ b/test/test_environ.py 2022-06-09 10:50:36.223708927 +0300
@@ -624,7 +624,7 @@
response.delete_cookie('name')
cookies = [value for name, value in response.headerlist
if name.title() == 'Set-Cookie']
- self.assertTrue('name=;' in cookies[0])
+ self.assertTrue('Max-Age=-1' in cookies[0])
def test_set_header(self):
response = BaseResponse()
and patch which bases on 9161e24e Here it is result:
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nInternal Server Error\n \n \n' _____________________________________________________ TestOutputFilter.test_error_in_generator_callback ______________________________________________________ self =
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nUnhandled exception\n \n \n' _________________________________________________________________ TestSendFile.test_download _________________________________________________________________ self =
Bottle master branch should be tested with python -m unittest discover
as shown in Makefile
or pytest
as done by the github action.
Bottle release-0.12
should be tested by running test/testall.py
as shown in the Makefile
or tox.ini
. The cleanup that allows tests to run without this wrapper happened after the release of 0.12 and was never back-ported from master.
There is still a single failing tests, but that is caused by a behavior change in pythos stdlib with no real-world impact. The test fails with never python versions, but the code still works as expected. The proposed fix for that test would break for older python versions, so that's not really an improvement.
pytest can handle correctly written unittest
test suite.
Also please notice that unittest
is no longer extended and is not well maintainmed. This is why +90% of all modules curretnly is not usig unittest
and used pytest
.
I can point as well that using currentl;y pytest with bottle
has some vale as it shows many DeprecationWarning
warnings.
Please do not ignore what shows pytest.
Here is updated pytest output with 0.12.21
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nInternal Server Error\n \n \n' _____________________________________________________ TestOutputFilter.test_error_in_generator_callback ______________________________________________________ self =
Sorry, the requested URL 'http://127.0.0.1/'\n caused an error:
\nUnhandled exception\n \n \n' _________________________________________________________________ TestSendFile.test_download _________________________________________________________________ self =
FYI on packagin all p[ython modules I'm usig pep517 build procedure:
python3 -sBm build -w --no-isolation
build
with --no-isolation
I'm using during all processes only locally installed modulespytest can handle correctly written unittest test suite.
As I said, the 0.12 branch requires environment adjustments (see test/testall.py
) for tests work properly. Just running unitest or pytest won't work. Fixing the test suite for a branch that is in maintenance mode for years now is not my top priority at the moment, so you could either call test/testall.py
to run tests (which will also fail because of Python stdlib changes over the years) or wait until someone invests the time and fixes the test environment.
I can point as well that using currentl;y pytest with bottle has some vale as it shows many DeprecationWarning warnings. Please do not ignore what shows pytest.
PRs that fix DeprecationWarnings without breaking stuff are always welcomed.
Failing cookie-test is fixed in release-0.12
(but not released). The test/testall.py
requirement is also removed, so pytest and unittest should both work now.
I've copied to may package test procedure which is in Fedora package however it fails. How bottle should be tested? I see tox.ini file however looks like under python >= 3.8 nothing is tested.
Some warning says that code needs to be updated for python >= 3.8.