From 32ceb6423a5035b8bf9a0ceabf3c927a40eef303 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Fri, 2 Feb 2024 14:46:50 -0500 Subject: [PATCH] tests: Skip some snapshot tests on Python 3.7 The latest versions of Textual only support Python 3.8 and higher, so differences from the snapshot are expected when running Python 3.7. Signed-off-by: Matt Wozniski --- tests/unit/test_tree_reporter.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit/test_tree_reporter.py b/tests/unit/test_tree_reporter.py index b73f3b62b5..7c09b53d35 100644 --- a/tests/unit/test_tree_reporter.py +++ b/tests/unit/test_tree_reporter.py @@ -1,3 +1,4 @@ +import sys from dataclasses import dataclass from textwrap import dedent from typing import Any @@ -1594,6 +1595,10 @@ def generate_primes(): getlines.return_value = code.splitlines() assert compare(peak_allocations, press=[]) + @pytest.mark.skipif( + sys.version_info < (3, 8), + "The snapshot is generated with Textual 0.48, which doesn't support Python 3.7", + ) def test_basic_node_selected_not_leaf(self, compare): # GIVEN code = dedent( @@ -1709,6 +1714,10 @@ def generate_primes(): getlines.return_value = code.splitlines() assert compare(peak_allocations, press=[]) + @pytest.mark.skipif( + sys.version_info < (3, 8), + "The snapshot is generated with Textual 0.48, which doesn't support Python 3.7", + ) def test_two_chains_after_expanding_second(self, compare): # GIVEN code = dedent( @@ -1909,6 +1918,10 @@ def generate_primes(): getlines.return_value = code.splitlines() assert compare(peak_allocations, press=["u", "i"]) + @pytest.mark.skipif( + sys.version_info < (3, 8), + "The snapshot is generated with Textual 0.48, which doesn't support Python 3.7", + ) def test_select_screen(self, tmp_path, compare): # GIVEN code = dedent(