예제 #1
0
 def Metafunc(self, func):
     # the unit tests of this class check if things work correctly
     # on the funcarg level, so we don't need a full blown
     # initiliazation
     class FixtureInfo:
         name2fixturedefs = None
         def __init__(self, names):
             self.names_closure = names
     names = funcargs.getfuncargnames(func)
     fixtureinfo = FixtureInfo(names)
     return funcargs.Metafunc(func, fixtureinfo, None)
예제 #2
0
 def Metafunc(self, func):
     # the unit tests of this class check if things work correctly
     # on the funcarg level, so we don't need a full blown
     # initiliazation
     class FixtureInfo:
         name2fixturedefs = None
         def __init__(self, names):
             self.names_closure = names
     names = funcargs.getfuncargnames(func)
     fixtureinfo = FixtureInfo(names)
     return funcargs.Metafunc(func, fixtureinfo, None)
예제 #3
0
 def test_wrapped_getfuncargnames(self):
     from _pytest.python import getfuncargnames
     def wrap(f):
         def func():
             pass
         func.__wrapped__ = f
         return func
     @wrap
     def f(x):
         pass
     l = getfuncargnames(f)
     assert l == ("x",)
예제 #4
0
 def test_wrapped_getfuncargnames_patching(self):
     from _pytest.python import getfuncargnames
     def wrap(f):
         def func():
             pass
         func.__wrapped__ = f
         func.patchings = ["qwe"]
         return func
     @wrap
     def f(x, y, z):
         pass
     l = getfuncargnames(f)
     assert l == ("y", "z")
예제 #5
0
    def test_wrapped_getfuncargnames(self):
        from _pytest.python import getfuncargnames

        def wrap(f):
            def func():
                pass

            func.__wrapped__ = f
            return func

        @wrap
        def f(x):
            pass

        l = getfuncargnames(f)
        assert l == ("x", )
예제 #6
0
    def test_wrapped_getfuncargnames_patching(self):
        from _pytest.python import getfuncargnames

        def wrap(f):
            def func():
                pass

            func.__wrapped__ = f
            func.patchings = ["qwe"]
            return func

        @wrap
        def f(x, y, z):
            pass

        l = getfuncargnames(f)
        assert l == ("y", "z")