Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: