November 21, 2021

Combine Coverage for Different Python Versions

Is it enough to run code coverage for a single Python version? Probably, but not necessarily. Especially when you still need to support Python 2.7 (sigh), there could be quite some different code paths for Python 2 and Python 3. A simple example… try: import Queue # Python 2 except ImportError: import queue as Queue # Python 3 But also the different Python 3 versions may require that you not only test your code for each interpreter, but also you need to assess code coverage for the different versions, and certainly you want to make sure you got all paths covered....