From fa420f36e0af8043d7197cda39a2834f7659cd68 Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli Date: Sun, 22 Sep 2024 16:20:56 +0200 Subject: [PATCH] chore: future-proof Duration type error message test (#3606) --- tests/utils/test_to_values_narwhals.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/utils/test_to_values_narwhals.py b/tests/utils/test_to_values_narwhals.py index ac9fd9ed1..81cc5d348 100644 --- a/tests/utils/test_to_values_narwhals.py +++ b/tests/utils/test_to_values_narwhals.py @@ -1,3 +1,4 @@ +import re import sys from datetime import datetime from pathlib import Path @@ -63,7 +64,8 @@ def test_duration_raises(): # Check that exception mentions the duration[ns] type, # which is what the pandas timedelta is converted into - assert ( - 'Field "timedelta" has type "Duration" which is not supported by Altair' - in e.value.args[0] + + assert re.match( + r'^Field "timedelta" has type "Duration.*" which is not supported by Altair', + e.value.args[0], )