summaryrefslogtreecommitdiff
path: root/cherrypy/test
Commit message (Collapse)AuthorAgeFilesLines
* Move import statement to top of the filechiatchiat2023-04-011-2/+1
|
* Update cherrypy/test/test_logging.pychiatchiat2023-04-011-2/+1
| | | Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
* [pre-commit.ci] auto fixes from pre-commit.com hookspre-commit-ci[bot]2023-03-301-1/+1
| | | | for more information, see https://pre-commit.ci
* Fix: LazyRfc3339UtcTime return correct utc timechiatchiat2023-03-291-0/+30
|
* 🐛 Close unreleased HTTP connections @ testsSviatoslav Sydorenko2023-01-092-0/+17
|
* Introduce SanitizedHost wrapper. Fixes #1974.Jason R. Coombs2022-07-171-3/+0
|
* Add test capturing missed expectation. Ref #1974.Jason R. Coombs2022-07-171-0/+13
|
* Merge PR #1933Sviatoslav Sydorenko2022-02-011-1/+1
|\
| * Fix tutorial testKrystian Rosiński2021-09-131-1/+1
| |
* | Merge PR #1932Sviatoslav Sydorenko2022-02-0110-13/+13
|\ \
| * | Replace cherrypy.org to cherrypy.devManeesh Babu M2021-09-1110-13/+13
| |/
* | Use context managers to close files properly and fix tests on PyPyMichał Górny2022-02-018-39/+33
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use context managers (`with`) to ensure that all open files are closed correctly. This resolves resource leaks and test failures with PyPy3.7. The code prior to this change used four approaches for closing files: 1. Using a context manager (`with` clause). 2. Using a try/finally clause. 3. Closing the file in the same scope (unreliable: file object can leak on exception). 4. Not closing open files at all. The last point is a real problem for PyPy since it does not GC unreachable objects as aggressively as CPython does. While leaving a function scope on CPython causes the file objects private to it to be destroyed (and therefore closed), in PyPy they can stay dangling for some time. When combines with buffered writes, this means that writes can still remain pending after returning from function. Using a context manager is a simple, consistent way to ensure that the file object is closed once it is no longer needed. In turn, this guarantees that all pending writes will be performed upon function return and the code won't be hiting race conditions between writing a file and reading it afterwards.
* Close hanging fd in testHandlerToolConfigOverrideDuncan Bellamy2021-01-171-2/+2
|
* Turn on ServerStateTests::test_2_KeyboardInterruptSviatoslav Sydorenko2020-12-111-4/+0
| | | | Resolves #1873
* Merge PR #1892Sviatoslav Sydorenko2020-11-291-4/+14
|\ | | | | | | | | This change fixes `test_bus::test_block` expectations regarding the optional log line mentioning the thread name.
| * <= 1Christian Clauss2020-11-291-1/+1
| |
| * Update test_bus.pyChristian Clauss2020-11-291-1/+1
| |
| * Update test_bus.pyChristian Clauss2020-11-291-1/+5
| |
| * White quotesChristian Clauss2020-11-291-5/+5
| |
| * Fix text_block() to ignore the final messageChristian Clauss2020-11-291-4/+9
|/
* Use white quotesChristian Clauss2020-11-191-2/+2
|
* xfail test_wait_publishes_periodically() on macOSChristian Clauss2020-11-181-0/+4
| | | A targeted subset of #1877 which [happens on both CircleCI and Travis CI](https://github.com/cherrypy/cherrypy/pull/1877/files#r524250775).
* Skip running test_2_KeyboardInterrupt with xfailSviatoslav Sydorenko2020-11-171-7/+4
| | | | | | | This change completely skipps the test because neither using pytest-forked, nor using just `xfail` with `raises` seems to be able to isolate the failure without affecting the whole test suite run.
* Make test_2_KeyboardInterrupt run in fork @ POSIXSviatoslav Sydorenko2020-11-171-1/+8
|
* Mark test_2_KeyboardInterrupt as xfailingChristian Clauss2020-11-171-0/+1
|
*-. Merge PR #1882, PR #1883 and PR #1884Sviatoslav Sydorenko2020-11-162-4/+1
|\ \ | | | | | | | | | | | | This change upgrades the macOS env in Circle CI, bumps Travis CI env to Ubuntu Focal and drops xfail from test_queue_full.
| | * Remove pytest.mark.xfail on test_queue_fullChristian Clauss2020-11-161-2/+0
| | |
| | * Remove pytest.mark.xfail on test_queue_fullChristian Clauss2020-11-161-1/+0
| |/ |/| | | | | | | Closes #1535 This test passes consistently on Travis CI so perhaps [resolving #1839 fixed #1535](https://github.com/cherrypy/cherrypy/issues/1535#issuecomment-581424282).
| * def example(): # noqa: F811Christian Clauss2020-11-161-1/+1
|/
* Fix compression level in meta header in gzip toolbugfixes/1849-gzip-compression-header-cpython-bug39389Sviatoslav Sydorenko2020-11-151-0/+17
| | | | | | | | | | * https://bugs.python.org/issue39389 * https://github.com/python/cpython/pull/18077 * https://github.com/python/cpython/pull/18100 * https://github.com/python/cpython/pull/18101 Fixes #1849
* Fix the creation of BytesIO in `serve_fileobj_utf8_filename`Sviatoslav Sydorenko2020-04-171-1/+1
|
* Serve test module itself in `serve_file_utf8_filename`Sviatoslav Sydorenko2020-04-171-2/+1
|
* Refactor utf-8 content-disposition filename test casesSviatoslav Sydorenko2020-04-171-3/+6
|
* Add a comment to the quoted file nameSviatoslav Sydorenko2020-04-171-1/+1
|
* Use an in-mem file-like obj in the `/serve_fileobj_utf8_filename` handlerSviatoslav Sydorenko2020-04-171-2/+1
|
* Fix serving files with diacritics in name under their original nameJan Rieger2020-04-171-0/+29
| | | | | | | | | | | | This implements adding extra ``filename*`` parameter in Content-disposition header when serving content with non-ASCII filenames. As per RFC 6266 recommendations in the Appendix D. Refs: * https://stackoverflow.com/a/8996249/2173868 * https://tools.ietf.org/html/rfc6266#appendix-D Fixes #1776
* Revert "Fix serving files with diacritics in name under their original name"Jan Rieger2020-04-171-29/+0
| | | | This reverts commit 1741fd9adf70800fd692c24b0d85f5caad6a44e5.
* Fix serving files with diacritics in name under their original nameJan Rieger2020-04-171-0/+29
| | | | | | | | | | | | This implements adding extra ``filename*`` parameter in Content-disposition header when serving content with non-ASCII filenames. As per RFC 6266 recommendations in the Appendix D. Refs: * https://stackoverflow.com/a/8996249/2173868 * https://tools.ietf.org/html/rfc6266#appendix-D Fixes #1776
* Merge pull request #1821 from cherrypy/feature/getPage-passthroughJason R. Coombs2019-11-031-10/+3
|\ | | | | Pass arguments from CPWebCase.getPage to WebCase.getPage without replicating signature.
| * Pass arguments from CPWebCase.getPage to WebCase.getPage without replicating ↵Jason R. Coombs2019-10-171-10/+3
| | | | | | | | signature. Ref #1818.
* | Uncomment known bugs items in the modwsgi testJared2019-11-031-9/+9
| | | | | | | | | | | | | | | | Sphinx warnings fixed: * cherrypy/test/modwsgi.py:docstring of cherrypy.test.modwsgi:16: WARNING: Unexpected indentation. * cherrypy/test/modwsgi.py:docstring of cherrypy.test.modwsgi:17: WARNING: Block quote ends without a blank line; unexpected unindent. * cherrypy/test/modwsgi.py:docstring of cherrypy.test.modwsgi:25: WARNING: Unexpected indentation. * cherrypy/test/modwsgi.py:docstring of cherrypy.test.modwsgi:28: WARNING: Block quote ends without a blank line; unexpected unindent.
* | Fix docstring list indentation in test_httpJared2019-11-031-6/+8
| | | | | | | | | | Sphinx warnings fixed: * cherrypy/test/test_http.py:docstring of cherrypy.test.test_http.HTTPTests.test_post_filename_with_special_characters:3: WARNING: Unexpected indentation.
* | Remove xfail from test_HTTP11_Timeout_after_requestAllan Crooks2019-10-181-1/+0
| |
* | Fix test_HTTP11_Timeout_after_request to expect 408 responses in both parts ↵Allan Crooks2019-10-181-5/+3
|/ | | | of the test.
* Consolidate error message templateJason R. Coombs2019-10-151-5/+4
|
* Mark test as xfail until an assessment can be made. Ref #1817.Jason R. Coombs2019-10-151-0/+1
|
* Use mock.patch to avoid mutating global state outside the test.Jason R. Coombs2019-09-221-2/+6
|
* Rewrite the disallowed characters to only disallow newlines, allowing null ↵Jason R. Coombs2019-09-221-0/+3
| | | | bytes. Fixes #1781.
* Merge branch 'master' into bugfix/1779Jason R. Coombs2019-09-0310-428/+533
|\
| * Stop using deprecated ``assert_``Sviatoslav Sydorenko2019-08-192-2/+2
| |