Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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",)
Exemplo n.º 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")
Exemplo n.º 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", )
Exemplo n.º 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")