3434
3535# These libraries aren't always available, we'll skip tests if they aren't.
3636
37- try :
38- import eventlet
39- except ImportError :
40- eventlet = None
41-
4237try :
4338 import gevent
4439except ImportError :
@@ -151,12 +146,6 @@ def sum_range(limit):
151146 import queue
152147 """
153148
154- # Import the things to use eventlet.
155- EVENTLET = """
156- import eventlet.green.threading as threading
157- import eventlet.queue as queue
158- """
159-
160149# Import the things to use gevent.
161150GEVENT = """
162151 from gevent import monkey
@@ -266,14 +255,6 @@ def test_threads_simple_code(self) -> None:
266255 code = SIMPLE .format (QLIMIT = self .QLIMIT )
267256 self .try_some_code (code , "thread" , threading )
268257
269- def test_eventlet (self ) -> None :
270- code = (EVENTLET + SUM_RANGE_Q + PRINT_SUM_RANGE ).format (QLIMIT = self .QLIMIT )
271- self .try_some_code (code , "eventlet" , eventlet )
272-
273- def test_eventlet_simple_code (self ) -> None :
274- code = SIMPLE .format (QLIMIT = self .QLIMIT )
275- self .try_some_code (code , "eventlet" , eventlet )
276-
277258 # https://github.com/coveragepy/coveragepy/issues/663
278259 @pytest .mark .skipif (env .WINDOWS , reason = "gevent has problems on Windows: #663" )
279260 def test_gevent (self ) -> None :
@@ -306,6 +287,10 @@ def test_greenlet_simple_code(self) -> None:
306287 code = SIMPLE .format (QLIMIT = self .QLIMIT )
307288 self .try_some_code (code , "greenlet" , greenlet )
308289
290+ # The code in tracer.c that went with this test doesn't seem particular to
291+ # eventlet. I don't want to remove this test, but I don't know how to
292+ # rewrite it to demonstrate the original problem without eventlet.
293+ @pytest .mark .skip (reason = "We don't test eventlet; don't know how to rewrite this test." )
309294 def test_bug_330 (self ) -> None :
310295 BUG_330 = """\
311296 from weakref import WeakKeyDictionary
@@ -322,6 +307,7 @@ def do():
322307 eventlet.sleep(.1)
323308 print(len(gts))
324309 """
310+ eventlet = glob # quiet linters on the next line.
325311 self .try_some_code (BUG_330 , "eventlet" , eventlet , "0\n " )
326312
327313 # Sometimes a test fails due to inherent randomness. Try more times.
@@ -382,12 +368,12 @@ def test_bad_concurrency_in_config(self) -> None:
382368 self .command_line ("run prog.py" )
383369
384370 def test_no_multiple_light_concurrency (self ) -> None :
385- with pytest .raises (ConfigError , match = "Conflicting concurrency settings: eventlet, gevent " ):
386- self .command_line ("run --concurrency=gevent,eventlet prog.py" )
371+ with pytest .raises (ConfigError , match = "Conflicting concurrency settings: gevent, greenlet " ):
372+ self .command_line ("run --concurrency=gevent,greenlet prog.py" )
387373
388374 def test_no_multiple_light_concurrency_in_config (self ) -> None :
389- self .make_file (".coveragerc" , "[run]\n concurrency = gevent, eventlet \n " )
390- with pytest .raises (ConfigError , match = "Conflicting concurrency settings: eventlet, gevent " ):
375+ self .make_file (".coveragerc" , "[run]\n concurrency = gevent, greenlet \n " )
376+ with pytest .raises (ConfigError , match = "Conflicting concurrency settings: gevent, greenlet " ):
391377 self .command_line ("run prog.py" )
392378
393379 def test_multiprocessing_needs_config_file (self ) -> None :
@@ -398,7 +384,7 @@ def test_multiprocessing_needs_config_file(self) -> None:
398384class WithoutConcurrencyModuleTest (CoverageTest ):
399385 """Tests of what happens if the requested concurrency isn't installed."""
400386
401- @pytest .mark .parametrize ("module" , ["eventlet" , " gevent" , "greenlet" ])
387+ @pytest .mark .parametrize ("module" , ["gevent" , "greenlet" ])
402388 def test_missing_module (self , module : str ) -> None :
403389 self .make_file ("prog.py" , "a = 1" )
404390 sys .modules [module ] = None # type: ignore[assignment]
@@ -546,23 +532,6 @@ def test_multiprocessing_append(self, start_method: str) -> None:
546532 start_method = start_method ,
547533 )
548534
549- def test_multiprocessing_and_gevent (self , start_method : str ) -> None :
550- nprocs = 3
551- upto = 30
552- code = (SUM_RANGE_WORK + EVENTLET + SUM_RANGE_Q + MULTI_CODE ).format (
553- NPROCS = nprocs , UPTO = upto
554- )
555- total = sum (sum (range ((x + 1 ) * 100 )) for x in range (upto ))
556- expected_out = f"{ nprocs } pids, total = { total } "
557- self .try_multiprocessing_code (
558- code ,
559- expected_out ,
560- eventlet ,
561- nprocs ,
562- concurrency = "multiprocessing,eventlet" ,
563- start_method = start_method ,
564- )
565-
566535 @pytest .mark .skipif (
567536 not testenv .CAN_MEASURE_BRANCHES , reason = "Can't measure branches with this core"
568537 )
0 commit comments