-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3718 from Textualize/compositor-ignore-unmounted
Compositor ignores non-mounted widgets.
- Loading branch information
Showing
6 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Regression test for https://github.com/Textualize/textual/issues/2914 | ||
Make sure that calls to render only happen after a widget being mounted. | ||
""" | ||
|
||
import asyncio | ||
|
||
from textual.app import App | ||
from textual.widget import Widget | ||
|
||
|
||
class W(Widget): | ||
def render(self): | ||
return self.renderable | ||
|
||
async def on_mount(self): | ||
await asyncio.sleep(0.1) | ||
self.renderable = "1234" | ||
|
||
|
||
async def test_render_only_after_mount(): | ||
"""Regression test for https://github.com/Textualize/textual/issues/2914""" | ||
app = App() | ||
async with app.run_test() as pilot: | ||
app.mount(W()) | ||
app.mount(W()) | ||
await pilot.pause() |