From 43cd18d3e7dbba00d0de4dda136270070432042d Mon Sep 17 00:00:00 2001 From: James Howison Date: Wed, 3 Apr 2024 14:35:23 -0500 Subject: [PATCH] Update my_code.py --- my_code.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/my_code.py b/my_code.py index f06c356..dbdeadf 100644 --- a/my_code.py +++ b/my_code.py @@ -1,10 +1,6 @@ import pytest def fix_phone_num(phone_num_to_fix): - # can only handle numbers that are exactly 10 digits long - if (len(phone_num_to_fix) != 10): - raise ValueError("Can only format numbers that are exactly 10 digits long") - # given "5125558823". Split the parts, then recombine and return area_code = phone_num_to_fix[0:3] # 512 (first three digits) three_part = phone_num_to_fix[3:6] # 555 (next three digits) @@ -16,7 +12,3 @@ def fix_phone_num(phone_num_to_fix): def test_fix_phone_num(): assert fix_phone_num("5125558823") == '(512) 555 8823' - - # Now check that a too short string gives a ValueError - with pytest.raises(ValueError): - fix_phone_num("51")