<s> from warehouse . utils . attrs import make_repr <EOL> class TestMakeRepr : <EOL> def test_on_class ( self ) : <EOL> class Fake : <EOL> foo = "<STR_LIT:bar>" <EOL> __repr__ = make_repr ( "<STR_LIT:foo>" ) <EOL> assert repr ( Fake ( ) ) == "<STR_LIT>" . format ( repr ( "<STR_LIT:bar>" ) ) <EOL> def test_with_function ( self ) : <EOL> class Fake : <EOL> foo = "<STR_LIT:bar>" <EOL> def __repr__ ( self ) : <EOL> self . __repr__ = make_repr ( "<STR_LIT:foo>" , _self = self ) <EOL> return self . __repr__ ( ) <EOL> assert repr ( Fake ( ) ) == "<STR_LIT>" . format ( repr ( "<STR_LIT:bar>" ) ) </s>
