@pytest.mark.skipif('not HAS_BLEACH')
def test_raw_html_write():
 t = Table([['<em>x</em>'], ['<em>y</em>']], names=['a', 'b'])
 out = StringIO()
 t.write(out, format='ascii.html', htmldict={'raw_html_cols': 'a'})
 expected = '   <tr>\n    <td><em>x</em></td>\n    <td>&lt;em&gt;y&lt;/em&gt;</td>\n   </tr>'
 assert (expected in out.getvalue())
 out = StringIO()
 t.write(out, format='ascii.html', htmldict={'raw_html_cols': ['a']})
 assert (expected in out.getvalue())
 out = StringIO()
 t.write(out, format='ascii.html', htmldict={'raw_html_cols': ['a', 'b']})
 expected = '   <tr>\n    <td><em>x</em></td>\n    <td><em>y</em></td>\n   </tr>'
 assert (expected in out.getvalue())

@ pytest . mark . skipif ( 'not HAS_BLEACH' ) def test_raw_html_write ( ) : t = Table ( [ [ '<em>x</em>' ] , [ '<em>y</em>' ] ] , names = [ 'a' , 'b' ] ) out = StringIO ( ) t . write ( out , format = 'ascii.html' , htmldict = { 'raw_html_cols' : 'a' } ) expected = '   <tr>\n    <td><em>x</em></td>\n    <td>&lt;em&gt;y&lt;/em&gt;</td>\n   </tr>' assert ( expected in out . getvalue ( ) ) out = StringIO ( ) t . write ( out , format = 'ascii.html' , htmldict = { 'raw_html_cols' : [ 'a' ] } ) assert ( expected in out . getvalue ( ) ) out = StringIO ( ) t . write ( out , format = 'ascii.html' , htmldict = { 'raw_html_cols' : [ 'a' , 'b' ] } ) expected = '   <tr>\n    <td><em>x</em></td>\n    <td><em>y</em></td>\n   </tr>' assert ( expected in out . getvalue ( ) )
test that columns can contain raw html which is not escaped .