shaunagm / WelcomeBot

Other
35 stars 43 forks source link

test_nicks.csv and nicks.csv is overwritten during test execution #57

Open zxiiro opened 9 years ago

zxiiro commented 9 years ago

The files test_nicks.csv and nicks.csv are overwritten during test execution. Proper unittests should not modify the user's environment. Would recommend using something like tempfile [1] to create temporary files for testing.

Steps to reproduce:

  1. touch nicks.csv
  2. modify test_nicks.csv
  3. python -m unittest test_bot
  4. test_nicks.csv and nicks.csv is overwritten with test data

[1] https://docs.python.org/2/library/tempfile.html