@@ -1291,7 +1291,7 @@ def test_comment_serialization(self):
12911291 comm = ET .Comment ('<spam> & ham' )
12921292 self .assertEqual (ET .tostring (comm ), b'<!--<spam> & ham-->' )
12931293 self .assertEqual (ET .tostring (comm , method = 'html' ), b'<!--<spam> & ham-->' )
1294- self .assertEqual (ET .tostring (comm , method = 'text' ), b'<spam> & ham ' )
1294+ self .assertEqual (ET .tostring (comm , method = 'text' ), b'' )
12951295
12961296 def test_processinginstruction_serialization (self ):
12971297 # Test ProcessingInstruction directly
@@ -1308,8 +1308,10 @@ def test_processinginstruction_serialization(self):
13081308 self .assertEqual (ET .tostring (ET .PI ('test' , '<testing&>\xe3 ' ), 'latin-1' ),
13091309 b"<?xml version='1.0' encoding='latin-1'?>\n "
13101310 b"<?test <testing&>\xe3 ?>" )
1311- self .assertEqual (ET .tostring (ET .PI ('test' , 'ham & eggs < spam' ), method = 'html' ),
1312- b'<?test ham & eggs < spam?>' )
1311+ pi = ET .PI ('test' , 'ham & eggs < spam' )
1312+ self .assertEqual (ET .tostring (pi ), b'<?test ham & eggs < spam?>' )
1313+ self .assertEqual (ET .tostring (pi , method = 'html' ), b'<?test ham & eggs < spam?>' )
1314+ self .assertEqual (ET .tostring (pi , method = 'text' ), b'' )
13131315
13141316 def test_empty_attribute_serialization (self ):
13151317 elem = ET .Element ('tag' , attrib = {'attr' : None })
0 commit comments