aiogram/examples
Rishat-F 1df3adaba1
Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring (#1510)
* Smaller timeout for MongoStorage connection

By default serverSelectionTimeoutMS=30000. This is too much

* Correct ConnectionError for RedisStorage in tests

* Remove unused import in conftest.py

* Refactor skipping redis and mongo tests

* Fail redis and mongo tests if incorrect URI

If incorrect URIs provided to "--redis" and/or "--mongo" options
tests should fail with ERRORs instead of skipping.
Otherwise the next scenario is possible:
  1) developer breaks RedisStorage and/or MongoStorage code
  2) tests are run with incorrect redis and/or mongo URIs
     provided by "--redis" and "--mongo" options.
     For example, wrong port specified.
  3) tests pass because skipping doesn't fail tests run
  4) developer or reviewer doesn't notice
     that redis and/or mongo tests were skipped
  5) broken code gets in codebase

* Remove unused fixtures passing in storages tests

* Define create_storage_key fixture in conftest.py

* Linters formatting

* Changes description

* Revert "Smaller timeout for MongoStorage connection"

This reverts commit d88b7ec612.

* Smaller timeout for MongoStorage connection in tests

The default 30s timeout is too long

* Add test for MongoStorage for 100% coverage

* Linters formatting

* Move skipping redis/mongo tests in earlier fixtures

* Replace vars with constants in conftest.py

* Linters formatting
2024-06-17 00:55:59 +03:00
..
data Add example for media group. 2017-11-21 20:33:22 +02:00
multi_file_bot misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
web_app misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
context_addition_from_filter.py Bump dev dependencies (#1512) 2024-06-14 20:11:08 +03:00
echo_bot.py misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
echo_bot_webhook.py Bump dev dependencies (#1512) 2024-06-14 20:11:08 +03:00
echo_bot_webhook_ssl.py Bump dev dependencies (#1512) 2024-06-14 20:11:08 +03:00
error_handling.py misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
finite_state_machine.py misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
multibot.py Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring (#1510) 2024-06-17 00:55:59 +03:00
own_filter.py Bump dev dependencies (#1512) 2024-06-14 20:11:08 +03:00
quiz_scene.py misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
scene.py misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
specify_updates.py misc: code consistency and bot instance creation (#1482) 2024-05-31 20:11:21 +03:00
without_dispatcher.py Add context manager support for bot client (#1468) 2024-04-22 23:42:47 +03:00