Skip to content

Commit ee92363

Browse files
TimPansinolrafeeihmstepanekumaannamalai
authored
Fix starlette testing matrix for updated behavior. (#869)
Co-authored-by: Lalleh Rafeei <[email protected]> Co-authored-by: Hannah Stepanek <[email protected]> Co-authored-by: Uma Annamalai <[email protected]>
1 parent 6644846 commit ee92363

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

tests/framework_starlette/test_bg_tasks.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,20 @@ def _test():
8989

9090
# The bug was fixed in version 0.21.0 but re-occured in 0.23.1.
9191
# The bug was also not present on 0.20.1 to 0.23.1 if using Python3.7.
92-
BUG_COMPLETELY_FIXED = (0, 21, 0) <= starlette_version < (0, 23, 1) or (
93-
(0, 20, 1) <= starlette_version < (0, 23, 1) and sys.version_info[:2] > (3, 7)
92+
# The bug was fixed again in version 0.29.0
93+
BUG_COMPLETELY_FIXED = any(
94+
(
95+
(0, 21, 0) <= starlette_version < (0, 23, 1),
96+
(0, 20, 1) <= starlette_version < (0, 23, 1) and sys.version_info[:2] > (3, 7),
97+
starlette_version >= (0, 29, 0),
98+
)
99+
)
100+
BUG_PARTIALLY_FIXED = any(
101+
(
102+
(0, 20, 1) <= starlette_version < (0, 21, 0),
103+
(0, 23, 1) <= starlette_version < (0, 29, 0),
104+
)
94105
)
95-
BUG_PARTIALLY_FIXED = (0, 20, 1) <= starlette_version < (0, 21, 0) or starlette_version >= (0, 23, 1)
96-
97106
if BUG_COMPLETELY_FIXED:
98107
# Assert both web transaction and background task transactions are present.
99108
_test = validate_transaction_metrics(

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ envlist =
149149
python-framework_pyramid-{py37,py38,py39,py310,py311,pypy38}-Pyramidlatest,
150150
python-framework_sanic-{py38,pypy38}-sanic{190301,1906,1912,200904,210300,2109,2112,2203,2290},
151151
python-framework_sanic-{py37,py38,py39,py310,py311,pypy38}-saniclatest,
152-
python-framework_starlette-{py310,pypy38}-starlette{0014,0015,0019},
152+
python-framework_starlette-{py310,pypy38}-starlette{0014,0015,0019,0028},
153153
python-framework_starlette-{py37,py38}-starlette{002001},
154154
python-framework_starlette-{py37,py38,py39,py310,py311,pypy38}-starlettelatest,
155155
python-framework_strawberry-{py37,py38,py39,py310,py311}-strawberrylatest,
@@ -359,6 +359,7 @@ deps =
359359
framework_starlette-starlette0015: starlette<0.16
360360
framework_starlette-starlette0019: starlette<0.20
361361
framework_starlette-starlette002001: starlette==0.20.1
362+
framework_starlette-starlette0028: starlette<0.29
362363
framework_starlette-starlettelatest: starlette
363364
framework_strawberry: starlette
364365
framework_strawberry-strawberrylatest: strawberry-graphql

0 commit comments

Comments
 (0)