Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2f3dec

Browse files
committed
refactor: remove eventlet testing
See eventlet/eventlet#1089
1 parent 34b6763 commit e2f3dec

6 files changed

Lines changed: 15 additions & 55 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
exclude: "stress_phystoken|\\.py,cover$"
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.15.10
19+
rev: v0.15.11
2020
hooks:
2121
- id: ruff-format
2222

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ upgrading your version of coverage.py.
2323
Unreleased
2424
----------
2525

26-
Nothing yet.
26+
- We are no longer testing eventlet support. Eventlet issues stern deprecation
27+
warnings that break our tests. Our support code is still there.
2728

2829

2930
.. start-releases

requirements/light-threads.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
# The light-threads packages we test against.
77

8-
eventlet
98
gevent
109
greenlet
1110

requirements/light-threads.pip

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,6 @@ cffi==2.0.0 \
8888
# via
8989
# -r requirements/light-threads.in
9090
# gevent
91-
dnspython==2.8.0 \
92-
--hash=sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af \
93-
--hash=sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f
94-
# via eventlet
95-
eventlet==0.41.0 \
96-
--hash=sha256:35df85f0ccd3e73effb6fd9f1ceae46b500b966c7da1817289c323a307bd397b \
97-
--hash=sha256:bc22396093cb4119ff7007776be6a5348a613ccd42eeb0f9519853a6efcbcabe
98-
# via -r requirements/light-threads.in
9991
gevent==25.9.1 \
10092
--hash=sha256:012a44b0121f3d7c800740ff80351c897e85e76a7e4764690f35c5ad9ec17de5 \
10193
--hash=sha256:03c74fec58eda4b4edc043311fca8ba4f8744ad1632eb0a41d5ec25413581975 \
@@ -197,7 +189,6 @@ greenlet==3.3.2 \
197189
--hash=sha256:e3cb43ce200f59483eb82949bf1835a99cf43d7571e900d7c8d5c62cdf25d2f9
198190
# via
199191
# -r requirements/light-threads.in
200-
# eventlet
201192
# gevent
202193
pycparser==3.0 ; implementation_name != 'PyPy' \
203194
--hash=sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29 \

tests/test_concurrency.py

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@
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-
4237
try:
4338
import gevent
4439
except 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.
161150
GEVENT = """
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]\nconcurrency = gevent, eventlet\n")
390-
with pytest.raises(ConfigError, match="Conflicting concurrency settings: eventlet, gevent"):
375+
self.make_file(".coveragerc", "[run]\nconcurrency = 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:
398384
class 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
)

tests/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_toml_config_file(self, filename: str) -> None:
8686
[tool.somethingelse]
8787
authors = ["Joe D'Ávila <[email protected]>"]
8888
[tool.coverage.run]
89-
concurrency = ["thread", "eventlet"]
89+
concurrency = ["thread", "gevent"]
9090
timid = true
9191
data_file = ".hello_kitty.data"
9292
plugins = ["plugins.a_plugin"]
@@ -102,7 +102,7 @@ def test_toml_config_file(self, filename: str) -> None:
102102
cov = coverage.Coverage()
103103
assert cov.config.timid
104104
assert not cov.config.branch
105-
assert cov.config.concurrency == ["thread", "eventlet"]
105+
assert cov.config.concurrency == ["thread", "gevent"]
106106
assert cov.config.data_file == ".hello_kitty.data"
107107
assert cov.config.plugins == ["plugins.a_plugin"]
108108
assert cov.config.precision == 3

0 commit comments

Comments
 (0)