import unittest from pyson.JsonTools import getInitArgs from abc import ABC class JsonToolsTest(unittest.TestCase): def testGetInitArgs(self): class ClassWithInitVars: def __init__(self, x:int): y=2 self.assertEquals({"x":int}, getInitArgs(ClassWithInitVars)) def testGetInitArgsAbc(self): class BaseClass(ABC): pass class ClassWithInitVars2(BaseClass): def __init__(self, x:int): y=2 self.assertEquals({"x":int}, getInitArgs(ClassWithInitVars2))