Executing the code with
coverage run -m pytest will give a different result than just running it without
I have some pygame code that I want to test with py.test. I originally thought the bug to be caused by py.test, but it is actually caused by
minimal failing example
Running the test code with "./test_draw.py" will pass. Running the test code with "coverage run ./test_draw.py" will NOT pass. The code draws an antialiased line using pygame. This is tested against an reference image 'image.png'. It should look like 'image.png'. But using "coverage .." will result in 'image_test.png'
On my other machine with Python 2.7.6 the bug is not reproducable. On yet another machine with Python 2.7.10 the bug is also not reproducable.
coverage version on all three machines the same:
some more info about the system where the bug occurs:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu Xenial Xerus (development branch) Release: 16.04 Codename: xenial
Linux xaedes-vbox 4.3.0-2-generic #11-Ubuntu SMP Fri Dec 4 20:37:48 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
This is pytest version 2.8.5, imported from /usr/local/lib/python2.7/dist-packages/pytest.pyc setuptools registered plugins: pytest-cov-2.2.0 at /usr/local/lib/python2.7/dist-packages/pytest_cov/plugin.pyc pytest-mock-0.9.0 at /usr/local/lib/python2.7/dist-packages/pytest_mock.pyc