fix bug on sourced percentage, add test

Because of a integer division error, with one sourced line out of two,
the sourcing percentage was zero instead of 0.5. Added a test to check
this case.
for the record, adding `from __future__ import division` at the beginning of the file is a nicer way of fixing this