@pytest.mark.parametrize('constructor, attrs, expected', [(False, {}, '<test_utils.Obj>'), (False, {'foo': None}, '<test_utils.Obj foo=None>'), (False, {'foo': "b'ar", 'baz': 2}, '<test_utils.Obj baz=2 foo="b\'ar">'), (True, {}, 'test_utils.Obj()'), (True, {'foo': None}, 'test_utils.Obj(foo=None)'), (True, {'foo': "te'st", 'bar': 2}, 'test_utils.Obj(bar=2, foo="te\'st")')])
def test_get_repr(constructor, attrs, expected):
 assert (utils.get_repr(Obj(), constructor, **attrs) == expected)

@ pytest . mark . parametrize ( 'constructor, attrs, expected' , [ ( False , { } , '<test_utils.Obj>' ) , ( False , { 'foo' : None } , '<test_utils.Obj foo=None>' ) , ( False , { 'foo' : "b'ar" , 'baz' : 2 } , '<test_utils.Obj baz=2 foo="b\'ar">' ) , ( True , { } , 'test_utils.Obj()' ) , ( True , { 'foo' : None } , 'test_utils.Obj(foo=None)' ) , ( True , { 'foo' : "te'st" , 'bar' : 2 } , 'test_utils.Obj(bar=2, foo="te\'st")' ) ] ) def test_get_repr ( constructor , attrs , expected ) : assert ( utils . get_repr ( Obj ( ) , constructor , ** attrs ) == expected )
test get_repr() .