Closed
Description
update on idea of testing outputs as docstrings (e.g. with python -m doctest
):
I couldn't find easy way to generate docstrings for def main()
By "testing outputs" I mean to compare script output with ### OUTPUT ###
section at the bottom of the file.
Structuring scripts like that:
def main():
...
if __name__ == "__main__":
main()
allows imports of main
in tests to evaluate and compare outputs.
It would also be more convenient to have ### OUTPUT ###
section as variable or docstring, so we do not need to parse file for such comparisons