geoffroychaussonnet / script_to_monitor_Covid19

Python scripts to monitor Covid-19
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Missing if __name__ == "__main__" #12

Closed jferard closed 4 years ago

jferard commented 4 years ago

I noticed that running:

 python3 -m pytest --doctest-modules

has an annoying side effect: diagrams are displayed. We should have a main function in each script and the two lines:

if __name__ == "__main__":
    main()

See https://stackoverflow.com/a/28336701/6914441 for more information.

geoffroychaussonnet commented 4 years ago

ok, I'll change it soon

geoffroychaussonnet commented 4 years ago

solved with commit 5257676601b236fb4f9a69a68bbb4c6256af48ea

jferard commented 4 years ago

Nice. Now

$ python3 -m pytest --doctest-modules

works fine, and I can run scripts from my IDE (PyCharm).