dash icon indicating copy to clipboard operation
dash copied to clipboard

Fixes AIO Callback testing with Dash-Duo

Open MrTeale opened this issue 2 years ago • 2 comments

This PR fixes #1933. The AIO components are unable to be tested using Pytest and the Dash-Duo object. The callbacks set via dash.callback (rather than app.callback) are added to a global map that is cleared after the first instance of dash.Dash._setup_server.

To get around this, I'm currently exploring whether it is possible to leave the GLOBAL_CALLBACK_MAP and GLOBAL_CALLBACK_LIST populated rather than clearing them on setup.

Contributor Checklist

  • [x] I have broken down my PR scope into the following TODO tasks
    • [x] Explore whether it is as simple as allowing the MAP and LIST to remain populated
    • [] ~~If not, explore whether we can have another MAP as suggested by @T4rk1n in #1933~~
  • [x] I have run the tests locally and they passed. (refer to testing section in contributing)
  • [x] I have added entry in the CHANGELOG.md

MrTeale avatar May 23 '22 09:05 MrTeale

Turns out it is possible to not remove them from the GLOBAL_CALLBACK_MAP and clear the GLOBAL_CALLBACK_LIST and everything work fine.

Was there any particular reasoning as to removing them the way they were?

MrTeale avatar May 23 '22 09:05 MrTeale