Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.08 KB

python-coverage-guide.md

File metadata and controls

43 lines (29 loc) · 1.08 KB

Measuring coverage of Python activities

  • install the python3-coverage package,
sudo apt install python3-coverage
  • start Terminal activity inside Sugar,
  • change to the directory that holds activity source code,
  • run the activity like this;
python3-coverage run /usr/bin/sugar-activity3
  • run any test scripts, such as those using xdotool, or your test plan,
  • stop the activity,
  • generate annotated HTML listings,
python3-coverage html
  • run the http.server module in a background process,
python3 -m http.server &

Tested on Ubuntu 18.04 and 19.04.

See the Python Coverage documentation.

Measuring coverage during collaboration

When an activity is started to join a collaboration, there is little opportunity to intercept and add the command-line wrapper.

/usr/bin/sugar-activity3 may be edited to add coverage API calls. See Coverage.py API.