summaryrefslogtreecommitdiff
path: root/tests/test_connection.py
Commit message (Collapse)AuthorAgeFilesLines
* fix create single_connection_client from url (#2752)dvora-h2023-05-081-0/+8
|
* Optionally disable disconnects in read_response (#2695)Kristján Valur Jónsson2023-05-081-1/+1
| | | | | | | | | | | | | * Add regression tests and fixes for issue #1128 * Fix tests for resumable read_response to use "disconnect_on_error" * undo prevision fix attempts in async client and cluster * re-enable cluster test * Suggestions from code review * Add CHANGES
* Fix #2581 UnixDomainSocketConnection' object has no attribute ↵Sergey Prokazov2023-02-081-1/+43
| | | | | | | | | | | | | | | | | '_command_packer' (#2583) * Fix #2581 UnixDomainSocketConnection' object has no attribute '_command_packer' . Apparently there is no end-to-end tests for Unix sockets so automation didn't catch it. I assume that setting up domain sockets reliably in dockerized environment is not very trivial. Added test for pack_command specifically. * Figuring out why CI fails. Locally: " congratulations :)" * Fix the test. hiredis doesn't treat memoryviews differently.
* Make PythonParser resumable (#2510)Kristján Valur Jónsson2023-01-051-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | * PythonParser is now resumable if _stream IO is interrupted * Add test for parse resumability * Clear PythonParser state when connection or parsing errors occur. * disable test for cluster mode. * Perform "closed" check in a single place. * Update tests * Simplify code. * Remove reduntant test, EOF is detected inside _readline() * Make syncronous PythonParser restartable on error, same as HiredisParser Fix sync PythonParser * Add CHANGES * isort * Move MockStream and MockSocket into their own files
* Added retry mechanism on socket timeouts when connecting to the server (#1895)Bar Shaul2022-01-251-1/+49
|
* close socket after server disconnect (#1797)Paul Brown2021-12-161-0/+34
|
* Added black and isort (#1734)Anas2021-11-301-10/+13
|
* Pyupgrade + flynt + f-strings (#1759)Aarni Koskela2021-11-301-1/+1
| | | @akx Thank you so much for this! Thanks again for introducing me to a new tool that I'm sliding into my workflow as well.
* Adding RedisCluster client to support Redis Cluster Mode (#1660)Bar Shaul2021-11-251-0/+1
| | | | Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Anas <anas.el.amraoui@live.com>
* Unit tests fixes for compatibility (#1703)Chayim2021-11-141-18/+8
|
* Unit test fixes to carry pytest options through all tests (#1696)Chayim2021-11-101-0/+2
|
* Exposing the module version in loaded_modules (#1648)Chayim2021-10-261-1/+1
| | | | This is useful for the case where one wants to instantiate a module, knowing the back end version. The reason: behaviour may differ based on redis module versions.
* redisjson support (#1636)Chayim2021-10-251-1/+32
|
* Remove support for end-of-life Python 2.7 (#1318)Jon Dufresne2020-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove support for end-of-life Python 2.7 Python 2.7 is end of life. It is no longer receiving bug fixes, including for security issues. Python 2.7 went EOL on 2020-01-01. For additional details on support Python versions, see: Supported: https://devguide.python.org/#status-of-python-branches EOL: https://devguide.python.org/devcycle/#end-of-life-branches Removing support for EOL Pythons will reduce testing and maintenance resources while allowing the library to move towards a modern Python 3 style. Python 2.7 users can continue to use the previous version of redis-py. Was able to simplify the code: - Removed redis._compat module - Removed __future__ imports - Removed object from class definition (all classes are new style) - Removed long (Python 3 unified numeric types) - Removed deprecated __nonzero__ method - Use simpler Python 3 super() syntax - Use unified OSError exception - Use yield from syntax Co-authored-by: Andy McCurdy <andy@andymccurdy.com>
* Fix str/bytes mixup in PythonParser.read_response() (#1324)Jon Dufresne2020-04-131-0/+15
Calling str() on a bytes object can result in a BytesWarning being emitted and usually indicates a mixup between byte and string handling. Now, in the event of an invalid RESP response, use the repr value of the raw response in the exception message. Can further simplify the bytes/str handling by comparing the first byte as a bytes object instead of converting it to str. The bytes literal is available on all supported Pythons. This removes the need for the compatibility function, byte_to_chr().