summaryrefslogtreecommitdiff
path: root/tests/builtin_server
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #33865 -- Optimized LimitedStream wrapper.Nick Pope2023-01-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of LimitedStream is slow because .read() performs an extra copy into a buffer and .readline() performs two extra copies. The stream being wrapped is already typically a BytesIO object so this is unnecessary. This implementation has largely been untouched for 12 years and, inspired by a simpler implementation in werkzeug, it was possible to achieve the following performance improvement: LimitedStream.read() (single line): Mean +- std dev: [bench_limitedstream-main] 286 ns +- 6 ns -> [bench_limitedstream-patch] 227 ns +- 6 ns: 1.26x faster LimitedStream.readline() (single line): Mean +- std dev: [bench_limitedstream-main] 507 ns +- 11 ns -> [bench_limitedstream-patch] 232 ns +- 8 ns: 2.18x faster LimitedStream.read(8192) (single line): Mean +- std dev: [bench_limitedstream-main] 360 ns +- 8 ns -> [bench_limitedstream-patch] 297 ns +- 6 ns: 1.21x faster LimitedStream.readline(8192) (single line): Mean +- std dev: [bench_limitedstream-main] 602 ns +- 10 ns -> [bench_limitedstream-patch] 305 ns +- 10 ns: 1.98x faster LimitedStream.read() (multiple lines): Mean +- std dev: [bench_limitedstream-main] 290 ns +- 5 ns -> [bench_limitedstream-patch] 236 ns +- 6 ns: 1.23x faster LimitedStream.readline() (multiple lines): Mean +- std dev: [bench_limitedstream-main] 517 ns +- 19 ns -> [bench_limitedstream-patch] 239 ns +- 7 ns: 2.16x faster LimitedStream.read(8192) (multiple lines): Mean +- std dev: [bench_limitedstream-main] 363 ns +- 8 ns -> [bench_limitedstream-patch] 311 ns +- 11 ns: 1.17x faster LimitedStream.readline(8192) (multiple lines): Mean +- std dev: [bench_limitedstream-main] 601 ns +- 12 ns -> [bench_limitedstream-patch] 308 ns +- 7 ns: 1.95x faster Geometric mean: 1.59x faster
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-073-26/+26
|
* Refs #29069 -- Added test for calling request_finished signal by static file ↵Tom Forbes2020-04-201-1/+11
| | | | | | responses. Fixed in 41a3b3d18647b258331104520e76f977406c590d.
* Fixed #31240 -- Properly closed FileResponse when wsgi.file_wrapper is used.Florian Apolloner2020-02-113-0/+48
| | | | Thanks to Oskar Persson for the report.
* Fixed typos in test names and a comment.Min ho Kim2019-08-231-1/+1
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-4/+4
|
* Refs #23919 -- Removed unneeded str() callsClaude Paroz2017-01-201-4/+4
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-2/+2
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Removed a bit of builtin_server tests for Python ≤ 2.7.3.Tim Graham2016-11-101-11/+0
|
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-4/+3
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-2/+1
|
* Moved ServerHandler helper class to tests.Ramiro Morales2014-03-301-1/+48
| | | | It has been only used in the builtin_servers tests since Django 1.4.
* Removed superfluous models.py files.Aymeric Augustin2013-12-171-0/+0
| | | | | | | Added comments in the three empty models.py files that are still needed. Adjusted the test runner to add applications corresponding to test labels to INSTALLED_APPS even when they don't have a models module.
* Stopped using django.utils.unittest in the test suite.Aymeric Augustin2013-07-011-1/+1
| | | | Refs #20680.
* Fixed #18972 -- Refactored bundled wsgi server's chunking algorithm.Matthew Wood2013-03-201-8/+55
| | | | | Thanks to amosonn at yahoo.com for the report, @doda for the initial patch and @datagrok for the revamped logic and test case.
* Merged regressiontests and modeltests into the test root.Florian Apolloner2013-02-263-0/+55