Skip to content

Commit

Permalink
Merge pull request #61 from jakirkham/update_nonslice_err_msg
Browse files Browse the repository at this point in the history
Update type error message in `reformat_slice`
  • Loading branch information
jakirkham committed Feb 20, 2017
2 parents 9d16ad2 + 69dc08c commit 0d2b567
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion kenjutsu/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def reformat_slice(a_slice, a_length=None):
return new_slice
elif not isinstance(a_slice, slice):
raise TypeError(
"Expected a `slice` type. Instead got `%s`." % str(a_slice)
"Expected an index acceptable type."
" Instead got, `%s`." % str(a_slice)
)

if new_slice.step == 0:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def test_reformat_slice(self):

self.assertEqual(
str(e.exception),
"Expected a `slice` type. Instead got `None`."
"Expected an index acceptable type."
" Instead got, `None`."
)

with self.assertRaises(ValueError) as e:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_kenjutsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_reformat_slice(self):

self.assertEqual(
str(e.exception),
"Expected a `slice` type. Instead got `None`."
"Expected an index acceptable type."
" Instead got, `None`."
)

with self.assertRaises(ValueError) as e:
Expand Down

0 comments on commit 0d2b567

Please sign in to comment.