Skip to content

Commit eab4ae5

Browse files
committed
build: test light-threads on all versions of Python
And also use more compact tox environment syntax throughout tox.init
1 parent f2e4048 commit eab4ae5

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

tests/test_concurrency.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ def cant_trace_msg(concurrency: str, the_module: ModuleType | None) -> str | Non
192192
expected_out = None
193193
else:
194194
expected_out = (
195-
f"Can't support concurrency={concurrency} with PyTracer, only threads are supported.\n"
195+
f"Can't support concurrency={concurrency} with {testenv.REQUESTED_TRACER_CLASS}, "
196+
+ "only threads are supported.\n"
196197
)
197198
return expected_out
198199

@@ -350,9 +351,10 @@ def gwork(q):
350351
pytest.skip("Can't run test without gevent installed.")
351352
if not testenv.C_TRACER:
352353
assert out == (
353-
"Can't support concurrency=gevent with PyTracer, only threads are supported.\n"
354+
f"Can't support concurrency=gevent with {testenv.REQUESTED_TRACER_CLASS}, "
355+
+ "only threads are supported.\n"
354356
)
355-
pytest.skip("Can't run gevent with PyTracer")
357+
pytest.skip(f"Can't run gevent with {testenv.REQUESTED_TRACER_CLASS}.")
356358

357359
assert out == "done\n"
358360

tests/testenv.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
REQUESTED_CORE = os.getenv("COVERAGE_CORE", "ctrace")
1111

12+
REQUESTED_TRACER_CLASS = {
13+
"ctrace": "CTracer",
14+
"pytrace": "PyTracer",
15+
"sysmon": "SysMonitor",
16+
}[REQUESTED_CORE]
17+
1218
# Are we testing the C-implemented trace function?
1319
C_TRACER = REQUESTED_CORE == "ctrace"
1420

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extras =
2020
deps =
2121
-r requirements/pip.pip
2222
-r requirements/pytest.pip
23-
py3{10,11}: -r requirements/light-threads.pip
23+
py3{10,11,12,13,14}: -r requirements/light-threads.pip
2424

2525
# Windows can't update the pip version with pip running, so use Python
2626
# to install things.

0 commit comments

Comments
 (0)