A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nedbat/coveragepy/issues/667 below:

GitHub ยท Where software is built

Originally reported by David Martin (Bitbucket: frostedcheerios, GitHub: Unknown)

The following test file reproduces the bug:

#!python

from gevent import monkey; monkey.patch_all()
from gevent.threadpool import ThreadPool
import unittest

class ThreadPoolTests(unittest.TestCase):
    def executor(self):
        print('I ran in a real thread!')
        return 123

    def test_threadpool(self):
        pool = ThreadPool(10)
        print(pool.spawn(self.executor).get())
        pool.kill()

if __name__ == '__main__':
    unittest.main()

Running that file gives the following results:

$ coverage run --concurrency=gevent test_threadpool.py && coverage report -m
I ran in a real thread!
123
.
----------------------------------------------------------------------
Ran 1 test in 0.003s

OK
Name                 Stmts   Miss  Cover   Missing
--------------------------------------------------
test_threadpool.py      13      2    85%   7-8

I'm using the following python, gevent and coverage versions:

$ coverage --version
Coverage.py, version 4.5.1 with C extension
Documentation at https://coverage.readthedocs.io
$ python --version
Python 3.6.5 :: Anaconda, Inc.
$ python -c "import gevent; print(gevent.__version__)"
1.3.3

dmartin-gh, wjsi and Reonaydo


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4