Closed rpdelaney closed 5 years ago
parse_args
where an exception was raised if the user passed the -h
switch at runtime. This bug got through because the argument parser doesn't have any tests. It will probably have to be refactored to accept functional testing, maybe like described here: https://stackoverflow.com/questions/18160078/how-do-you-write-tests-for-the-argparse-portion-of-a-python-moduleI'm planning a rewrite so this should go to the back-burner.
In general, the test coverage is not where I would like it to be. This is partly for two reasons:
1) It's hard to do lots of functional tests for stuff that requires engine execution, since engine operations take so long to finish, and engine behavior can be non-deterministic. (It might be fruitful to investigate whether UCI engine behavior can be mocked in the testing environment.)
2) Overall the functions in python-chess-annotator are too long and complex (especially
analyze_game()
), which does not lend itself well to unit testing. (This is a bigger problem than just testing, since over-long functions make the application's behavior harder to read, harder follow during debugging, and make the project harder to maintain in general.)I'm going to leave this issue here to prod myself to improve this situation, and also to invite help from others on building in more tests.