From 84701cc92c65412b0f013d29b207e98dc12d577a Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Tue, 24 Dec 2024 12:37:35 +0300 Subject: [PATCH 1/2] Fix sphinx/build_docs warnings for maths/zellers_congruence --- maths/zellers_congruence.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/maths/zellers_congruence.py b/maths/zellers_congruence.py index 483fb000f86b..5bb2eea16dc9 100644 --- a/maths/zellers_congruence.py +++ b/maths/zellers_congruence.py @@ -4,13 +4,14 @@ def zeller(date_input: str) -> str: """ - Zellers Congruence Algorithm - Find the day of the week for nearly any Gregorian or Julian calendar date + | Zellers Congruence Algorithm + | Find the day of the week for nearly any Gregorian or Julian calendar date >>> zeller('01-31-2010') 'Your date 01-31-2010, is a Sunday!' - Validate out of range month + Validate out of range month: + >>> zeller('13-31-2010') Traceback (most recent call last): ... @@ -21,6 +22,7 @@ def zeller(date_input: str) -> str: ValueError: invalid literal for int() with base 10: '.2' Validate out of range date: + >>> zeller('01-33-2010') Traceback (most recent call last): ... @@ -31,30 +33,35 @@ def zeller(date_input: str) -> str: ValueError: invalid literal for int() with base 10: '.4' Validate second separator: + >>> zeller('01-31*2010') Traceback (most recent call last): ... ValueError: Date separator must be '-' or '/' Validate first separator: + >>> zeller('01^31-2010') Traceback (most recent call last): ... ValueError: Date separator must be '-' or '/' Validate out of range year: + >>> zeller('01-31-8999') Traceback (most recent call last): ... ValueError: Year out of range. There has to be some sort of limit...right? Test null input: + >>> zeller() Traceback (most recent call last): ... TypeError: zeller() missing 1 required positional argument: 'date_input' Test length of date_input: + >>> zeller('') Traceback (most recent call last): ... From df6fc93fc0cb033b5f91d33d0d20a74f4e5e7d22 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Sun, 29 Dec 2024 18:46:32 +0300 Subject: [PATCH 2/2] Fix --- maths/zellers_congruence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/zellers_congruence.py b/maths/zellers_congruence.py index 5bb2eea16dc9..b958ed3b8659 100644 --- a/maths/zellers_congruence.py +++ b/maths/zellers_congruence.py @@ -60,7 +60,7 @@ def zeller(date_input: str) -> str: ... TypeError: zeller() missing 1 required positional argument: 'date_input' - Test length of date_input: + Test length of `date_input`: >>> zeller('') Traceback (most recent call last):