[TIP] Coverage kills python with sys.settrace(None): how to work around?
Michael McNeil Forbes
michael.forbes+python at gmail.com
Mon Mar 9 11:36:16 PDT 2015
On Mar 9, 2015, at 6:32 AM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> On 3/9/15 5:52 AM, Michael McNeil Forbes wrote:
>> I am trying to run coverage via nosetests from setup.py, but once the coverage report is produced, coverage calls sys.settrace(None) which rapidly kills everything and I can no longer continue processing. (I would like to run some additional tests after like pep8 syntax checks etc.)
> I have not heard of this phenomenon before. Can you provide more details? Coverage ends its measurement by setting the trace function to None. Is your code online? Do you have steps to reproduce the problem?
Run python setup.py test. If you put the nosetests before the flake8 or check tests, then they will not be run. I will try to extract a minimal working example shortly.
More information about the testing-in-python