From bce4671a78811e59ec3fc9f1bd269af66ff3bfab Mon Sep 17 00:00:00 2001 From: Deuchnord Date: Mon, 22 Sep 2025 16:36:57 +0200 Subject: [PATCH] tests: fix `is_successful()` deprecation --- tests/dates.py | 10 +++++----- tests/general.py | 4 ++-- tests/output.py | 2 +- tests/position.py | 2 +- tests/timezone.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/dates.py b/tests/dates.py index daaa52b..94f22cd 100644 --- a/tests/dates.py +++ b/tests/dates.py @@ -6,7 +6,7 @@ from .utils import execute, KOSMORRO def test_with_date(): for arg in [["-d", "2020-01-27"], ["--date", "2020-01-27"], ["-d2020-01-27"]]: result = execute(KOSMORRO + arg) - assert result.is_successful() + assert result.successful assert ( result.stdout @@ -27,7 +27,7 @@ def test_with_incorrect_date_values(): value = "yolo-yo-lo" for arg in [["-d", value], ["--date", value], [f"-d{value}"]]: result = execute(KOSMORRO + arg) - assert not result.is_successful() + assert not result.successful assert ( result.stderr == f"The date {value} does not match the required YYYY-MM-DD format or the offset format.\n" @@ -36,7 +36,7 @@ def test_with_incorrect_date_values(): value = "2020-13-32" for arg in [["-d", value], ["--date", value], [f"-d{value}"]]: result = execute(KOSMORRO + arg) - assert not result.is_successful() + assert not result.successful assert ( result.stderr == f"The date {value} is not valid: month must be in 1..12\n" ) @@ -45,7 +45,7 @@ def test_with_incorrect_date_values(): def test_with_out_of_range_dates(): for arg in [["-d", "1789-05-05"], ["-d", "3000-01-01"]]: result = execute(KOSMORRO + arg) - assert not result.is_successful() + assert not result.successful assert ( result.stderr == "Moon phase can only be computed between August 9, 1899 and September 26, 2053\nThe date must be between July 28, 1899 and October 8, 2053\n" @@ -55,7 +55,7 @@ def test_with_out_of_range_dates(): def test_with_out_of_range_dates_for_moon_phase_only(): for arg in [["-d", "1899-07-30"], ["-d", "2053-10-06"]]: result = execute(KOSMORRO + arg) - assert result.is_successful() + assert result.successful assert ( result.stderr == "Moon phase can only be computed between August 9, 1899 and September 26, 2053\n" diff --git a/tests/general.py b/tests/general.py index e0fee1c..290699d 100644 --- a/tests/general.py +++ b/tests/general.py @@ -13,7 +13,7 @@ from babel.dates import format_date def test_run_without_argument(): result = execute(KOSMORRO) - assert result.is_successful() + assert result.successful stdout = result.stdout.split("\n") print(stdout) @@ -34,7 +34,7 @@ def test_help_message(): for arg in ["--help", "-h"]: result = execute(KOSMORRO + [arg]) - assert result.is_successful() + assert result.successful if python_version.major == 3 and python_version.minor < 13: assert ( diff --git a/tests/output.py b/tests/output.py index 84946a0..30c80cb 100644 --- a/tests/output.py +++ b/tests/output.py @@ -13,7 +13,7 @@ def test_json_output(): result = execute( KOSMORRO + ["--position=50.5876,3.0624", "-d2020-01-27", "--format=json"] ) - assert result.is_successful() + assert result.successful assert ( result.stdout == """{ diff --git a/tests/position.py b/tests/position.py index 5a81846..aa82654 100644 --- a/tests/position.py +++ b/tests/position.py @@ -7,7 +7,7 @@ from .utils import ( def check_command_return(result): - assert result.is_successful() + assert result.successful assert ( result.stdout == """Monday, January 27, 2020 diff --git a/tests/timezone.py b/tests/timezone.py index 648f182..a1f6802 100644 --- a/tests/timezone.py +++ b/tests/timezone.py @@ -7,7 +7,7 @@ from .utils import ( def check_command_return_t_plus_one(result): - assert result.is_successful() + assert result.successful assert ( result.stdout == """Monday, January 27, 2020 @@ -24,7 +24,7 @@ Note: All the hours are given in the UTC+1 timezone. def check_command_return_t_minus_one(result): - assert result.is_successful() + assert result.successful assert ( result.stdout == """Monday, January 27, 2020