4 ms·
Yup, I remember when I was learning Python, before I ever wrote any real tests, all my modules would be littered with: if arg[1] == 'test1': print func1(
by chubot 14y ago
Yup, I remember when I was learning Python, before I ever wrote any real tests, all my modules would be littered with:
if arg[1] == 'test1':
print func1(a)
elif arg[1] == 'test2':
print func1(b)
elif arg[1] == 'test3':
print func2(a)
...
Eventually I found it was way easier to stick this in a _test.py file :)