June 2017
Beginner
352 pages
8h 39m
English
Since we're using test-driven design, we expect our tests to fail at first. And indeed our test fails spectacularly for the simple reason that we haven't yet defined analyze_text():
$ python text_analyzer.pyE======================================================================ERROR: test_function_runs (__main__.TextAnalysisTests)----------------------------------------------------------------------Traceback (most recent call last): File "text_analyzer.py", line 5, in test_function_runs analyze_text()NameError: global name 'analyze_text' is not defined----------------------------------------------------------------------Ran 1 test in 0.001sFAILED (errors=1)
As you can see, unittest.main() produces a simple report ...
Read now
Unlock full access