@@ -553,11 +553,11 @@ def test_is_valid_string(version_str, expected):
553553 (1 , 0 , 0 , "rc.1" , None , "1.0.0.rc_1" ),
554554 (1 , 2 , 3 , "alpha.1" , None , "1.2.3.alpha_1" ),
555555 (1 , 2 , 3 , "beta.2.3" , None , "1.2.3.beta_2_3" ),
556- (1 , 0 , 0 , None , "build" , "1.0.0.postbuild " ),
557- (1 , 0 , 0 , None , "build.123" , "1.0.0.postbuild_123 " ),
558- (1 , 2 , 3 , "alpha" , "build" , "1.2.3.alpha.postbuild " ),
559- (1 , 2 , 3 , "alpha.1" , "build.123" , "1.2.3.alpha_1.postbuild_123 " ),
560- (10 , 20 , 30 , "beta.1.2.3" , "build.456.789" , "10.20.30.beta_1_2_3.postbuild_456_789 " ),
556+ (1 , 0 , 0 , None , "build" , "1.0.0.build " ),
557+ (1 , 0 , 0 , None , "build.123" , "1.0.0.build_123 " ),
558+ (1 , 2 , 3 , "alpha" , "build" , "1.2.3.alpha.build " ),
559+ (1 , 2 , 3 , "alpha.1" , "build.123" , "1.2.3.alpha_1.build_123 " ),
560+ (10 , 20 , 30 , "beta.1.2.3" , "build.456.789" , "10.20.30.beta_1_2_3.build_456_789 " ),
561561 ],
562562 ids = [
563563 "no_prerelease_no_metadata" ,
@@ -582,14 +582,14 @@ def test_to_python_version_replaces_special_chars():
582582 # Test that dots and dashes are replaced with underscores
583583 version = Version (1 , 2 , 3 , "alpha.beta" , "metadata.123" )
584584 result = version .to_python_version ()
585- assert result == "1.2.3.alpha_beta.postmetadata_123 "
585+ assert result == "1.2.3.alpha_beta.metadata_123 "
586586 assert '.' not in result .split ('.' )[- 1 ] # No dots in the last segment after splitting on main dots
587587
588588def test_to_python_version_vs_str ():
589589 # Verify that to_python_version and __str__ produce different outputs for versions with prerelease/metadata
590590 version = Version (1 , 2 , 3 , "alpha.1" , "build.123" )
591591 python_version = version .to_python_version ()
592592 semver_version = str (version )
593- assert python_version == "1.2.3.alpha_1.postbuild_123 "
593+ assert python_version == "1.2.3.alpha_1.build_123 "
594594 assert semver_version == "1.2.3-alpha.1+build.123"
595595 assert python_version != semver_version
0 commit comments