[AppTest] hotfix for the "css" branch after commit d45b044888

This commit is contained in:
Olivier Philippon
2022-05-27 15:57:55 +01:00
parent d45b044888
commit 6a2d0df8a7

View File

@@ -12,10 +12,10 @@ from unittest import mock
from rich.console import Console
from textual import events, errors
from textual._ansi_sequences import SYNC_START
from textual._clock import _Clock
from textual.app import WINDOWS
from textual._context import active_app
from textual._ansi_sequences import TERMINAL_MODES_ANSI_SEQUENCES
from textual.app import App, ComposeResult
from textual.driver import Driver
from textual.geometry import Size, Region
@@ -23,8 +23,6 @@ from textual.geometry import Size, Region
# N.B. These classes would better be named TestApp/TestConsole/TestDriver/etc,
# but it makes pytest emit warning as it will try to collect them as classes containing test cases :-/
_SYNC_START_SEQUENCE = TERMINAL_MODES_ANSI_SEQUENCES["sync_start"]
class AppTest(App):
def __init__(
@@ -192,7 +190,7 @@ class AppTest(App):
total_capture = self.total_capture
if not total_capture:
return None
screen_captures = total_capture.split(_SYNC_START_SEQUENCE)
screen_captures = total_capture.split(SYNC_START)
for single_screen_capture in reversed(screen_captures):
if len(single_screen_capture) > 30:
# let's return the last occurrence of a screen that seem to be properly "fully-paint"