Exemplo n.º 1
0
 def test_args_default(self):
     code = Code()
     varnames = ['x', ('y', 3)]
     assert code.args(varnames) == 'x, y=3'
     assert code.args(varnames, '*args') == 'x, y=3, *args'
     assert code.args(varnames, '*args',
                      '**kwargs') == 'x, y=3, *args, **kwargs'
Exemplo n.º 2
0
 def test_pyx_types(self):
     code = Code(pyx=True)
     varnames = ['x', 'y']
     assert code.args(varnames) == 'x, y'
     assert code.args(varnames, '*args') == 'x, y, *args'
     assert code.params(varnames) == 'object x, object y'
     assert code.params(varnames, '*args') == 'object x, object y, *args'
Exemplo n.º 3
0
 def test_args_simple(self):
     code = Code()
     varnames = ['x', 'y']
     assert code.args(varnames) == 'x, y'
     assert code.args(varnames, '*args') == 'x, y, *args'
     assert code.args(varnames, '*args',
                      '**kwargs') == 'x, y, *args, **kwargs'