From 7d08e0a7cdba1d500f748dc5db8dcb9af2392bbb Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Tue, 1 Mar 2022 16:23:05 +0000 Subject: [PATCH] Fixing test module on non-Windows platforms --- tests/test_win32_console.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_win32_console.py b/tests/test_win32_console.py index 3cb26a5b..120e4b9e 100644 --- a/tests/test_win32_console.py +++ b/tests/test_win32_console.py @@ -19,6 +19,12 @@ try: SCREEN_HEIGHT = 30 DEFAULT_STYLE_ATTRIBUTE = 16 + @dataclasses.dataclass + class StubScreenBufferInfo: + dwCursorPosition: COORD = COORD(CURSOR_X, CURSOR_Y) + dwSize: COORD = COORD(SCREEN_WIDTH, SCREEN_HEIGHT) + wAttributes: int = DEFAULT_STYLE_ATTRIBUTE + except ImportError: pass @@ -31,13 +37,6 @@ def test_windows_coordinates_to_ctype(): assert coord.Y == 1 -@dataclasses.dataclass -class StubScreenBufferInfo: - dwCursorPosition: COORD = COORD(CURSOR_X, CURSOR_Y) - dwSize: COORD = COORD(SCREEN_WIDTH, SCREEN_HEIGHT) - wAttributes: int = DEFAULT_STYLE_ATTRIBUTE - - @pytest.fixture def win32_handle(): handle = mock.sentinel