#NEWLINE# def test_read_edgelist_3( self ) : #NEWLINE# #INDENT# s = b"# comment line\n1 2 {'weight':2.0}\n# comment line\n2 3 {'weight':3.0}\n" #NEWLINE# bytesIO = io . BytesIO ( s ) #NEWLINE# G = nx . read_edgelist ( bytesIO , nodetype = int , data = False ) #NEWLINE# assert_equal_edges ( G . edges ( ) , [ ( 1 , 2 ) , ( 2 , 3 ) ] ) #NEWLINE# bytesIO = io . BytesIO ( bytesIO ) #NEWLINE# G = nx . read_edgelist ( bytesIO , nodetype = int , data = True ) #NEWLINE# assert_equal_edges ( G . edges ( data = True ) , [ ( 1 , 2 , { #NEWLINE# #INDENT# 'weight' : 2.0 , #NEWLINE# #UNINDENT# } ) , ( 2 , 3 , { #NEWLINE# #INDENT# 'weight' : 3.0 , #NEWLINE# #UNINDENT# } ) ] )