mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
[AppTest] hotfix for the "css" branch after commit d45b044888
This commit is contained in:
@@ -12,10 +12,10 @@ from unittest import mock
|
|||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
|
|
||||||
from textual import events, errors
|
from textual import events, errors
|
||||||
|
from textual._ansi_sequences import SYNC_START
|
||||||
from textual._clock import _Clock
|
from textual._clock import _Clock
|
||||||
from textual.app import WINDOWS
|
from textual.app import WINDOWS
|
||||||
from textual._context import active_app
|
from textual._context import active_app
|
||||||
from textual._ansi_sequences import TERMINAL_MODES_ANSI_SEQUENCES
|
|
||||||
from textual.app import App, ComposeResult
|
from textual.app import App, ComposeResult
|
||||||
from textual.driver import Driver
|
from textual.driver import Driver
|
||||||
from textual.geometry import Size, Region
|
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,
|
# 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 :-/
|
# 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):
|
class AppTest(App):
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -192,7 +190,7 @@ class AppTest(App):
|
|||||||
total_capture = self.total_capture
|
total_capture = self.total_capture
|
||||||
if not total_capture:
|
if not total_capture:
|
||||||
return None
|
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):
|
for single_screen_capture in reversed(screen_captures):
|
||||||
if len(single_screen_capture) > 30:
|
if len(single_screen_capture) > 30:
|
||||||
# let's return the last occurrence of a screen that seem to be properly "fully-paint"
|
# let's return the last occurrence of a screen that seem to be properly "fully-paint"
|
||||||
|
|||||||
Reference in New Issue
Block a user