WelcomeBot icon indicating copy to clipboard operation
WelcomeBot copied to clipboard

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

Open zxiiro opened this issue 9 years ago • 0 comments

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

zxiiro avatar Apr 13 '15 02:04 zxiiro