aiogram/tests
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/locales Dev 3.x i18n & improvements (#696) 2021-09-22 00:52:38 +03:00
test_api Added full support of Bot API 7.4 (#1498) 2024-05-31 20:07:11 +03:00
test_dispatcher Bump dev dependencies (#1512) 2024-06-14 20:11:08 +03:00
test_filters Added full support of Bot API 7.1 (#1417) 2024-02-16 23:44:35 +02:00
test_flags Dev 3.x flat package (#961) 2022-08-14 01:07:52 +03:00
test_fsm Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring (#1510) 2024-06-17 00:55:59 +03:00
test_handler Removed the use of the context instance (Bot.get_current) from all placements that were used previously. (#1230) 2023-07-28 22:23:32 +03:00
test_issues #1317 Fixed priority of events isolation (#1318) 2023-09-21 22:54:48 +03:00
test_utils Apply isort (#1508) 2024-06-11 03:08:08 +03:00
test_webhook Upgrade to py12 (#1354) 2023-11-18 21:24:19 +02:00
__init__.py Update tests and small refactoring 2019-11-16 22:32:26 +02:00
conftest.py Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring (#1510) 2024-06-17 00:55:59 +03:00
deprecated.py Upgrade architecture + 5.0 Bot API (#469) 2021-01-26 21:20:52 +02:00
docker-compose.yml Added MongoStorage for FSM (#1434) 2024-05-07 22:42:31 +03:00
mocked_bot.py "Add get_mounted_bot function and improve model comparison in tests" 2023-07-16 22:46:45 +03:00