示例#1
0
def test_setup_func_not_callable():
    from _pytest.nose import call_optional

    class A:
        f = 1

    call_optional(A(), "f")
示例#2
0
def test_setup_func_not_callable():
    from _pytest.nose import call_optional

    class A(object):
        f = 1

    call_optional(A(), "f")
示例#3
0
def test_setup_func_with_setup_decorator():
    from _pytest.nose import call_optional
    l = []
    class A:
        @pytest.fixture(autouse=True)
        def f(self):
            l.append(1)
    call_optional(A(), "f")
    assert not l
示例#4
0
def test_setup_func_with_setup_decorator():
    from _pytest.nose import call_optional
    l = []
    class A:
        @pytest.fixture(autouse=True)
        def f(self):
            l.append(1)
    call_optional(A(), "f")
    assert not l