@@ -685,13 +685,13 @@ def test_without_extras(marker: str, expected: str):
685685 (
686686 'python_version >= "3.6" and (extra == "foo" or extra == "bar")' ,
687687 "python_version" ,
688- '( extra == "foo" or extra == "bar") ' ,
688+ 'extra == "foo" or extra == "bar"' ,
689689 ),
690690 (
691691 'python_version >= "3.6" and (extra == "foo" or extra == "bar") or'
692692 ' implementation_name == "pypy"' ,
693693 "python_version" ,
694- '( extra == "foo" or extra == "bar") or implementation_name == "pypy"' ,
694+ 'extra == "foo" or extra == "bar" or implementation_name == "pypy"' ,
695695 ),
696696 (
697697 'python_version >= "3.6" and extra == "foo" or implementation_name =='
@@ -705,6 +705,11 @@ def test_without_extras(marker: str, expected: str):
705705 "implementation_name" ,
706706 'python_version >= "3.6" or extra == "foo" or extra == "bar"' ,
707707 ),
708+ (
709+ 'extra == "foo" and python_version >= "3.6" or python_version >= "3.6"' ,
710+ "extra" ,
711+ 'python_version >= "3.6"' ,
712+ ),
708713 ],
709714)
710715def test_exclude (marker : str , excluded : str , expected : str ):
@@ -728,7 +733,7 @@ def test_exclude(marker: str, excluded: str, expected: str):
728733 (
729734 'python_version >= "3.6" and (extra == "foo" or extra == "bar")' ,
730735 ["extra" ],
731- '( extra == "foo" or extra == "bar") ' ,
736+ 'extra == "foo" or extra == "bar"' ,
732737 ),
733738 (
734739 'python_version >= "3.6" and (extra == "foo" or extra == "bar") or'
@@ -768,6 +773,14 @@ def test_union_of_a_single_marker_is_the_single_marker():
768773 assert SingleMarker ("python_version" , ">= 2.7" ) == union
769774
770775
776+ def test_union_of_multi_with_a_containing_single ():
777+ single = parse_marker ('python_version >= "2.7"' )
778+ multi = parse_marker ('python_version >= "2.7" and extra == "foo"' )
779+ union = multi .union (single )
780+
781+ assert union == single
782+
783+
771784@pytest .mark .parametrize (
772785 "marker, inverse" ,
773786 [
0 commit comments