From e11d642f7b64c4c93493b6660245953c34b0151d Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Fri, 22 May 2020 15:37:18 +0100 Subject: [PATCH] Merge pull request #10383 from astrofrog/fix-test-unicode-as-char Fix test_unicode_as_char test --- astropy/io/votable/tests/converter_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astropy/io/votable/tests/converter_test.py b/astropy/io/votable/tests/converter_test.py index 15d046bce240..08cb2cd0c148 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