python-telegram-bot/tests
Jacob Bom 247577b2e2
Context based callbacks (#1100)
See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-11.0 under Context based callbacks and Filters in handlers for a good guide on the changes in this commit.

* Change handlers so context is supported

* Attempt to make parameter "guessing" work on py < 3.5

* Document use_context in all handlers

* Add Context to docs

* Minor fixes to context handling

* Add tests for context stuff

* Allow the signature check to work on py<3.5 with methods

* Fix order of operations

* Address most issues raised in CR

* Make CommandHandler no longer support filter lists

* Fix indent

(pycharm can be an arse sometimes)

* Improve readability in conversationhandler

* Make context have Match instead of groups & groupdict

* Remove filter list support from messagehandler too

* Small fix to StringCommandHandler

* More small fixes to handlers

* Amend CHANGES

* Fix tests and fix bugs raised by tests

* Don't allow users to ignore errors without messing with the warning filters themselves

* Ignore our own deprecation warnings when testing

* Skipping deprecationwarning test on py2

* Forgot some changes

* Handler: Improved documentation and text of deprecation warnings

* HandlerContext: Keep only dispatcher and use properties; improved doc

* Complete fixing the documentation.

 - Fixes per Eldinnie's comments.
 - Fixes per warnings when running sphinx.

* Some small doc fixes (interlinks and optionals)

* Change add_error_handler to use HandlerContext too

* More context based changes

Context Based Handlers -> Context Based Callbacks

No longer use_context args on every single Handler

Instead set dispatcher/updater .use_context=True to use

Works with
- Handler callbacks
- Error handler callbacks
- Job callbacks

Change examples to context based callbacks so new users are not confused

Rename and move the context object from Handlers.HandlerContext to CallbackContext, since it doesn't only apply to handlers anymore.

Fix tests by adding a new fixture `cpd` which is a dispatcher with use_context=True

* Forgot about conversationhandler

* Forgot jobqueue

* Add tests for callbackcontext & for context based callback job

* Fix as per review :)
2018-05-21 15:00:47 +02:00
..
data Switch to pytest + required fixes to code (#788) 2017-08-12 00:58:41 +03:00
__init__.py Fix travis 2015-09-07 16:33:00 -03:00
bots.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
conftest.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_animation.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_audio.py Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
test_bot.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_callbackcontext.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_callbackquery.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_callbackqueryhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_chat.py Add t.me links for User, Chat and Message if available and update User.mention_* (#1092) 2018-05-09 11:42:12 +02:00
test_chatmember.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_choseninlineresult.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_choseninlineresulthandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_commandhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_constants.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_contact.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_conversationhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_dispatcher.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_document.py Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
test_error.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_file.py Improved File.download (#1019) 2018-03-01 10:10:04 +02:00
test_filters.py Add a caption_entity filter for filtering caption entities (#1068) 2018-04-20 13:24:40 +02:00
test_forcereply.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_game.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_gamehighscore.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_helpers.py Added utils.helpers.effective_message_type (#826) 2018-02-15 11:21:19 +02:00
test_inlinekeyboardbutton.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinekeyboardmarkup.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_inlinequery.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_inlinequeryhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_inlinequeryresultarticle.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultaudio.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedaudio.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcacheddocument.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedgif.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedmpeg4gif.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedphoto.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedsticker.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedvideo.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcachedvoice.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultcontact.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultdocument.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultgame.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultgif.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultlocation.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultmpeg4gif.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultphoto.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultvenue.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultvideo.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inlinequeryresultvoice.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inputcontactmessagecontent.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inputfile.py InputFile: Fix proper naming of file when reading from subprocess.PIPE (#1079) 2018-05-03 00:17:54 +03:00
test_inputlocationmessagecontent.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inputmedia.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inputtextmessagecontent.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_inputvenuemessagecontent.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_invoice.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_jobqueue.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_keyboardbutton.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_labeledprice.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_location.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_message.py Add t.me links for User, Chat and Message if available and update User.mention_* (#1092) 2018-05-09 11:42:12 +02:00
test_messageentity.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_messagehandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_messagequeue.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_meta.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_official.py Remove deprecated code (#1012) 2018-02-22 14:17:06 +02:00
test_orderinfo.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_parsemode.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_photo.py Inputfile encode filenames (#1086) 2018-04-25 23:13:00 +03:00
test_precheckoutquery.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_precheckoutqueryhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_regexhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_replykeyboardmarkup.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_replykeyboardremove.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_request.py Handle utf8 decoding errors (#1076) 2018-04-17 07:40:02 +03:00
test_shippingaddress.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_shippingoption.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_shippingquery.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_shippingqueryhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_sticker.py Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
test_stringcommandhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_stringregexhandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_successfulpayment.py flake8 revamp 2018-02-19 12:41:38 +02:00
test_telegramobject.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_typehandler.py Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
test_update.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_updater.py Updater improvements (#1018) 2018-03-02 23:11:16 +02:00
test_user.py Add t.me links for User, Chat and Message if available and update User.mention_* (#1092) 2018-05-09 11:42:12 +02:00
test_userprofilephotos.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_venue.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00
test_video.py Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
test_videonote.py Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
test_voice.py Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
travis_fold.py Update headers to 2018 (#962) 2018-01-04 17:16:06 +02:00