diff --git a/astropy/io/votable/tests/converter_test.py b/astropy/io/votable/tests/converter_test.py index 15d046bce24..08cb2cd0c14 100644 --- a/astropy/io/votable/tests/converter_test.py +++ b/astropy/io/votable/tests/converter_test.py @@ -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 @@ -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