I have the following code:
def test(testFunc):
def runTest(*args, **kwargs):
testFunc(*args, **kwargs)
return runTest
@test
def func1():
pass
@test
def func2():
pass
tests = [func1, func2]
def RunTest():
testList = [x.__name__ for x in tests ]
print(testList)
Running above code prints [runTest, runTest]
which is the name of the decorator. Any idea why this happens and how to fix it?