textual icon indicating copy to clipboard operation
textual copied to clipboard

unmount event

Open willmcgugan opened this issue 1 year ago • 0 comments

This started out as adding an UnMount event, which lead me down a rabbit-hole of how we run and shutdown Textual apps.

It also gave me the opportunity to re-think testing. I've added a run_test context manager which I think is the answer to testing we have been looking for.

I've deleted the older integration tests because I think that a combination of run_test and snapshot testing will be easier to maintain.

@darrenburns I've afraid I've deleted a few lines of snapshot tests where you inspect the app object afterwords, which no longer works with the run refactor. I think the new testing stuff is ultimately more useful, so I hope you won't be too disappointed.

Fixed

  • Fixed issue where scrollbars weren't being unmounted

Changed

  • DOMQuery now raises InvalidQueryFormat in response to invalid query strings, rather than cryptic CSS error
  • Dropped quit_after, screenshot, and screenshot_title from App.run, which can all be done via auto_pilot
  • Widgets are now closed in reversed DOM order

Added

  • Added Unmount event
  • Added App.run_async method
  • Added App.run_test context manager
  • Added auto_pilot to App.run and App.run_async
  • Added Widget._get_virtual_dom to get scrollbars

willmcgugan avatar Oct 27 '22 16:10 willmcgugan