Skip to content

Commit

Permalink
Merge pull request #772 from alimcmaster1/test-cov-lat
Browse files Browse the repository at this point in the history
Add test for invalid separator in isoparser
  • Loading branch information
pganssle committed Jun 20, 2018
2 parents 6dde5d6 + fb77107 commit ef6cddd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/772.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added tests that an error is raised for an incorrect separator character in a strict isoparser. Contribution by @alimcmaster1 (gh pr #772).
11 changes: 7 additions & 4 deletions dateutil/test/test_isoparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,15 @@ def test_iso_raises(isostr, exception):
isoparse(isostr)


@pytest.mark.parametrize('sep_act,valid_sep', [
('C', 'T'),
('T', 'C')
@pytest.mark.parametrize('sep_act, valid_sep, exception', [
('T', 'C', ValueError),
('C', 'T', ValueError),
])
def test_iso_raises_sep(sep_act, valid_sep):
def test_iso_with_sep_raises(sep_act, valid_sep, exception):
parser = isoparser(sep=valid_sep)
isostr = '2012-04-25' + sep_act + '01:25:00'
with pytest.raises(exception):
parser.isoparse(isostr)


@pytest.mark.xfail()
Expand Down

0 comments on commit ef6cddd

Please sign in to comment.