def test_conv_str_type():
 param = inspect.Parameter('foo', inspect.Parameter.POSITIONAL_ONLY)
 with pytest.raises(TypeError) as excinfo:
  argparser.type_conv(param, 'val', None)
 assert (str(excinfo.value) == 'foo: Legacy string type!')

def test_conv_str_type ( ) : param = inspect . Parameter ( 'foo' , inspect . Parameter . POSITIONAL_ONLY ) with pytest . raises ( TypeError ) as excinfo : argparser . type_conv ( param , 'val' , None ) assert ( str ( excinfo . value ) == 'foo: Legacy string type!' )
using a str literal as type used to mean exactly thats a valid value .