#NEWLINE# @ pytest . mark . parametrize ( [ 'source' , 'result' ] , [ ( '8000' , ( '' , 8000 ) ) , ( 'foo:8000' , ( 'foo' , 8000 ) ) , ( 'foo' , None ) ] ) #NEWLINE# def test_parse_address( source , result ) : #NEWLINE# #INDENT# if ( result is None ) : #NEWLINE# #INDENT# with pytest . raises ( ConfigurationError ) as exc : #NEWLINE# #INDENT# parse_address ( result ) #NEWLINE# #UNINDENT# assert ( 'Misconfigured bind address' in str ( exc ) ) #NEWLINE# assert ( '`foo`' in str ( exc ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( parse_address ( source ) == result )