Nov. 27, 2015, 12:39 a.m.

A Hypen can ruin EVERYTHING!

I was working through examples from Python Testing's unittest intro. I was applying them to my HelloFlask dice rolling app. I ran into trouble in the "Test discovery" section. I'd run the python -m unittest discover {testfile_name} and it wouldn't find or run any tests. Turns out, I had a hypen in the file name (test_re-match_unittest.py instead of test_rematch_unittest.py) and THAT was causing unittest to have problems. When I put the test file in the simple_example directory, I got an import error saying the module couldn't be imported. If I tried to run it with the discover option DIRECTLY on the file, it just wouldn't find or run any tests.

Hyphens count!


Add comment

No comments here yet. 為甚麼?!? :(