@@ -32,10 +32,20 @@ def _warnings(caplog):
3232 ("azure-functions-durable>=2.0.0b1" , True ),
3333 ("azure-functions-durable>=2,<4" , True ),
3434 ("azure-functions-durable>=2,<3.1" , True ),
35+ ("azure-functions-durable>=2.0.0rc5,<3.0.0rc2" , True ),
36+ ("azure-functions-durable>=2.0.0rc5,<3.0.0rc0" , True ),
37+ ("azure-functions-durable>=2.0.0rc5,<3.0.0a0" , True ),
38+ ("--pre\n azure-functions-durable>=2.0.0rc5,<=3.0.0,!=3.0.0" , True ),
39+ (
40+ "azure-functions-durable>=2.0.0rc5,<3.0.0rc2,"
41+ "!=3.0.0.dev0,!=3.0.0a0,!=3.0.0b0,!=3.0.0rc0" ,
42+ True ,
43+ ),
3544 ("azure-functions-durable!=3.*" , True ),
3645 ("azure-functions-durable!=3.0.0" , True ),
3746 ("azure-functions-durable<3" , False ),
3847 ("azure-functions-durable>=2.0.0b1,<3" , False ),
48+ ("azure-functions-durable>=2.0.0rc5,<3.0.0.dev0" , False ),
3949 ("azure-functions-durable==2.*" , False ),
4050 ("azure-functions-durable==2.0.0rc5" , False ),
4151 ("azure-functions-durable~=2.0" , False ),
@@ -72,6 +82,14 @@ def test_suggested_constraint_preserves_the_installed_epoch(monkeypatch, tmp_pat
7282 assert "azure-functions-durable>=1!2.3,<1!3" in _warnings (caplog )[0 ]
7383
7484
85+ def test_future_major_prerelease_preserves_the_installed_epoch (monkeypatch , tmp_path , caplog ):
86+ monkeypatch .setattr (dependency_warning , "version" , lambda name : "1!2.0rc5" )
87+ (tmp_path / "requirements.txt" ).write_text (
88+ "azure-functions-durable>=1!2.0rc5,<1!3.0rc2" , encoding = "utf-8" )
89+ dependency_warning .warn_if_unbounded (str (tmp_path ), logging .getLogger (__name__ ))
90+ assert "azure-functions-durable>=1!2.0rc5,<1!3" in _warnings (caplog )[0 ]
91+
92+
7593def test_a_higher_major_in_an_older_epoch_is_not_an_upgrade (monkeypatch , tmp_path , caplog ):
7694 monkeypatch .setattr (dependency_warning , "version" , lambda name : "1!2.0" )
7795 (tmp_path / "requirements.txt" ).write_text ("azure-functions-durable>=2,<1!3" , encoding = "utf-8" )
@@ -320,9 +338,10 @@ async def async_fail():
320338
321339 wrapped = invocation .wrap_invocation (async_fail if use_async else fail )
322340 with pytest .raises (ValueError , match = "invocation failed" ):
323- result = wrapped (context = context )
324341 if use_async :
325- await result
342+ await wrapped (context = context )
343+ else :
344+ wrapped (context = context )
326345
327346 assert checked == [context ]
328347 assert invocation .get_invocation_id () is None
0 commit comments