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

    class A:
        f = 1

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

    class A(object):
        f = 1

    call_optional(A(), "f")
Beispiel #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
Beispiel #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