Exemple #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"'
Exemple #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
Exemple #3
0
def test_strip_marker_extra_cancelled():
    marker = get_without_extra(Marker('extra == "sock" or extra == "huh"'))
    assert marker is None
Exemple #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"'
Exemple #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"'
Exemple #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"'
Exemple #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"'
Exemple #8
0
def test_strip_marker_extra_only():
    marker = get_without_extra(Marker('extra == "sock"'))
    assert marker is None
Exemple #9
0
def test_strip_marker_none():
    marker = get_without_extra(None)
    assert marker is None