Esempio n. 1
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'
Esempio n. 2
0
 def test_params_simple(self):
     code = Code()
     varnames = ['x', 'y']
     assert code.params(varnames) == 'x, y'
     assert code.params(varnames, '*args') == 'x, y, *args'
     assert code.params(varnames, '*args',
                        '**kwargs') == 'x, y, *args, **kwargs'
Esempio n. 3
0
 def test_pyx_default(self):
     code = Code(pyx=True)
     varnames = ['x', ('y', 3)]
     assert code.params(varnames) == 'object x, object y=3'
     assert code.params(varnames, '*args') == 'object x, object y=3, *args'