diff options
author | Kristján Valur Jónsson <sweskman@gmail.com> | 2022-07-26 12:25:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-26 15:25:23 +0300 |
commit | 6f208212ed9114921840404591aecca9acd38f08 (patch) | |
tree | ab37049c4d6b5c04a11b32c85218d50bd8d54d52 /tests/test_asyncio/test_json.py | |
parent | 1df1d32bb6845d2ccbbc340199babe9fe0ef29d6 (diff) | |
download | redis-py-6f208212ed9114921840404591aecca9acd38f08.tar.gz |
Fix warnings and resource usage problems in asyncio unittests (#2258)
* Use pytest-asyncio in auto mode
Remove overly genereric `pytestmark=pytest.mark.asyncio` causing lots of warning noise
* Use "Factories as Fixtures" test pattern for the `create_redis` fixture
this fixture is now async, avoiding teardown problems with missing event loops.
* Fix sporadic error on fast event loops, such as `--uvloop`
* Close connection, even if "username" was in kwargs
This fixes a resource usage warning in the async unittests.
* Do async cleanup of acl passwords via a fixture
* Remove unused import, fix whitespace
* Fix test with missing "await"
* Close pubsub objects after use in unittest
Use a simple fixture where possible, otherwise manually call pubsub.close()
* re-introduce `pytestmark=pytest.mark.asyncio` for python 3.6
* Use context manager to clean up connections in connection pool for unit tests
* Provide asynccontextmanager for python 3.6
* make `test_late_subscribe()` more robuste
* Catch a couple of additional leaked resources
Diffstat (limited to 'tests/test_asyncio/test_json.py')
-rw-r--r-- | tests/test_asyncio/test_json.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/test_asyncio/test_json.py b/tests/test_asyncio/test_json.py index a045dd7..416a9f4 100644 --- a/tests/test_asyncio/test_json.py +++ b/tests/test_asyncio/test_json.py @@ -5,8 +5,6 @@ from redis import exceptions from redis.commands.json.path import Path from tests.conftest import skip_ifmodversion_lt -pytestmark = pytest.mark.asyncio - @pytest.mark.redismod async def test_json_setbinarykey(modclient: redis.Redis): |