From cda6c1177d40cbbb630ee23b80182ef82d6b64cc Mon Sep 17 00:00:00 2001 From: satyakam Date: Mon, 12 Oct 2026 13:05:33 +0530 Subject: [PATCH] Fixed extra spaces issue and removed xfail marker --- fixit/textutils.py | 2 +- tests/test_convert.py | 1 - tests/test_textutils.py | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fixit/textutils.py b/fixit/textutils.py index 3b4d33e..d4437c5 100644 --- a/fixit/textutils.py +++ b/fixit/textutils.py @@ -8,4 +8,4 @@ def is_palindrome(text: str) -> bool: def reverse_words(text: str) -> str: """Reverse the order of words in text.""" - return " ".join(reversed(text.split(" "))) + return " ".join(reversed(text.split())) diff --git a/tests/test_convert.py b/tests/test_convert.py index 80c2bf1..f82a496 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -14,7 +14,6 @@ def test_f_to_c(): def test_km_to_miles(): assert km_to_miles(10) == pytest.approx(6.21371, rel=1e-4) - def test_miles_to_km(): assert miles_to_km(1) == pytest.approx(1.609344) diff --git a/tests/test_textutils.py b/tests/test_textutils.py index 6843628..a51a607 100644 --- a/tests/test_textutils.py +++ b/tests/test_textutils.py @@ -16,6 +16,5 @@ def test_palindrome_ignores_punctuation(): assert is_palindrome("A man, a plan, a canal: Panama") -@pytest.mark.xfail(reason="Known bug: extra spaces create empty words") def test_reverse_words_extra_spaces(): assert reverse_words("hello world") == "world hello"