Skip to content

Commit

Permalink
Merge pull request astropy#10383 from astrofrog/fix-test-unicode-as-char
Browse files Browse the repository at this point in the history
Fix test_unicode_as_char test
  • Loading branch information
astrofrog committed May 22, 2020
1 parent 8adf541 commit e11d642
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions astropy/io/votable/tests/converter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_unicode_as_char():

# Test parsing.
c.parse('XYZ') # ASCII succeeds
with pytest.raises(
with pytest.warns(
exceptions.W55,
match=r'FIELD \(unicode_in_char\) has datatype="char" but contains non-ASCII value'):
c.parse("zła") # non-ASCII
Expand All @@ -85,11 +85,11 @@ def test_unicode_as_char():
c.output(b'XYZ', False) # ASCII bytes succeeds
value = 'zła'
value_bytes = value.encode('utf-8')
with pytest.raises(
with pytest.warns(
exceptions.E24,
match=r'E24: Attempt to write non-ASCII value'):
c.output(value, False) # non-ASCII str raises
with pytest.raises(
with pytest.warns(
exceptions.E24,
match=r'E24: Attempt to write non-ASCII value'):
c.output(value_bytes, False) # non-ASCII bytes raises
Expand Down

0 comments on commit e11d642

Please sign in to comment.