Example #1
0
def test_strip_marker_extra_paranthesized_cancelled():
    marker = get_without_extra(
        Marker(
            '(extra == "sock") or (extra == "huh") or (sys_platform == "Windows")',
        ))
    assert str(marker) == 'sys_platform == "Windows"'
Example #2
0
def test_strip_marker_extra_crazy_cancelled():
    marker = get_without_extra(
        Marker(
            '(extra == "foo" or extra == "sock") or '
            '(extra == "huh" or extra == "bar")', ))
    assert marker is None
Example #3
0
def test_strip_marker_extra_cancelled():
    marker = get_without_extra(Marker('extra == "sock" or extra == "huh"'))
    assert marker is None
Example #4
0
def test_strip_marker_extra_noop():
    marker = get_without_extra(
        Marker('os_name == "nt" or sys_platform == "Windows"'), )
    assert str(marker) == 'os_name == "nt" or sys_platform == "Windows"'
Example #5
0
def test_strip_marker_extra_crazy():
    marker = get_without_extra(
        Marker(
            '(os_name == "nt" or sys_platform == "Windows" and extra == "huh") '
            'and extra == "sock"', ))
    assert str(marker) == 'os_name == "nt" or sys_platform == "Windows"'
Example #6
0
def test_strip_marker_extra_in_front():
    marker = get_without_extra(Marker('extra == "sock" or os_name == "nt"'))
    assert str(marker) == 'os_name == "nt"'
Example #7
0
def test_strip_marker_extra_simple():
    marker = get_without_extra(Marker('os_name == "nt" and extra == "sock"'))
    assert str(marker) == 'os_name == "nt"'
Example #8
0
def test_strip_marker_extra_only():
    marker = get_without_extra(Marker('extra == "sock"'))
    assert marker is None
Example #9
0
def test_strip_marker_none():
    marker = get_without_extra(None)
    assert marker is None