@@ -794,14 +794,13 @@ def test_autoversion_default(stack: Stack, simple_lambda_function: PyFunction) -
794
794
stack .add (auto_version )
795
795
print (stack .export ()["Resources" ])
796
796
assert stack .export ()["Resources" ] == EXPECTED_AUTOVERSION_DEFAULT_TEMPLATE
797
- assert (
798
- version := auto_version .get_version (1 )
799
- ) and version .name == "mypylambdaVersion1"
800
- assert (
801
- version := auto_version .get_version (2 )
802
- ) and version .name == "mypylambdaVersion2"
803
- assert (version := auto_version .previous ) and version .name == "mypylambdaVersion1"
804
- assert (version := auto_version .latest ) and version .name == "mypylambdaVersion2"
797
+ assert auto_version .get_version (1 ).name == "mypylambdaVersion1"
798
+ assert auto_version .get_version (2 ).name == "mypylambdaVersion2"
799
+ assert auto_version .previous .name == "mypylambdaVersion1"
800
+ assert auto_version .latest .name == "mypylambdaVersion2"
801
+
802
+ with pytest .raises (ValueError ):
803
+ auto_version .get_version (3 )
805
804
806
805
807
806
def test_autoversion_single (stack : Stack , simple_lambda_function : PyFunction ) -> None :
@@ -832,14 +831,10 @@ def test_autoversion(stack: Stack, simple_lambda_function: PyFunction) -> None:
832
831
stack .add (auto_version )
833
832
print (stack .export ()["Resources" ])
834
833
assert stack .export ()["Resources" ] == EXPECTED_AUTOVERSION_TEMPLATE
835
- assert (
836
- version := auto_version .get_version (2 )
837
- ) and version .name == "mypylambdaVersion2"
838
- assert (
839
- version := auto_version .get_version (3 )
840
- ) and version .name == "mypylambdaVersion3"
841
- assert (version := auto_version .previous ) and version .name == "mypylambdaVersion2"
842
- assert (version := auto_version .latest ) and version .name == "mypylambdaVersion3"
834
+ assert auto_version .get_version (2 ).name == "mypylambdaVersion2"
835
+ assert auto_version .get_version (3 ).name == "mypylambdaVersion3"
836
+ assert auto_version .previous .name == "mypylambdaVersion2"
837
+ assert auto_version .latest .name == "mypylambdaVersion3"
843
838
844
839
845
840
def test_bluegreenaliases_default (
0 commit comments