MT#56753 remove warning on test

> bin/check.py:113
>  /code/bin/check.py:113: PytestCollectionWarning: cannot collect test class 'Test' because it has a __init__ constructor (from: tests/test_check.py)
>    class Test:
>
>-- Docs: https://docs.pytest.org/en/stable/warnings.html

Change-Id: I6917ba773203abb02d3989fa411a8c8ee4363c93
mr11.3
Victor Seva 2 years ago
parent 205b3dce02
commit c22da979c9

@ -110,7 +110,7 @@ class Section(Flag):
SIP_OUT = 16
class Test:
class CTest:
"""Class to create TAP output"""
@ -164,7 +164,7 @@ class Test:
def test(self, section, value_expected, value, msg_err, msg_ok=None):
"""Test two values and add the result"""
result = Test.compare(value_expected, value)
result = CTest.compare(value_expected, value)
val = {"result": result, "msg_err": msg_err, "msg_ok": msg_ok}
self._step.append(val)
if not result:
@ -335,7 +335,7 @@ def main(args):
scen = load_yaml(args.test_yaml_file)
test = Test()
test = CTest()
try:
check = load_json(args.kam_file)

@ -28,7 +28,7 @@ lib_path = os.path.abspath("bin")
sys.path.append(lib_path)
from check import Section # noqa
from check import check_sip, check_sip_out # noqa
from check import XAvp, Test, check_flow, check_flow_vars # noqa
from check import XAvp, CTest, check_flow, check_flow_vars # noqa
from check import load_json, load_yaml # noqa
not_ok = re.compile("^not ok.*", re.MULTILINE)
@ -60,7 +60,7 @@ class TestXAvp(unittest.TestCase):
]
self.xavp = XAvp("$xavp(%s)" % self.name, self.data)
def test_init(self):
def test_init_values(self):
self.assertEqual(self.name, self.xavp._name)
self.assertCountEqual(self.data, self.xavp._data)
@ -110,7 +110,7 @@ class TestXAvpName(unittest.TestCase):
]
self.xavp = XAvp("$xavp(%s)" % self.name, self.data)
def test_init(self):
def test_init_values(self):
self.assertEqual(self.name, self.xavp._name)
self.assertCountEqual(self.data, self.xavp._data)
@ -127,7 +127,7 @@ class TestXAvpName(unittest.TestCase):
class TestCheckFlowVars(unittest.TestCase):
def setUp(self):
self.ctest = Test()
self.ctest = CTest()
self.check_ok = [
{
"R0": {
@ -203,7 +203,7 @@ class TestCheckFlowVars(unittest.TestCase):
class TestCheckSipIn(unittest.TestCase):
def setUp(self):
self.ctest = Test()
self.ctest = CTest()
self.msg = open("./tests/fixtures/sip_in.txt", "r").read()
def testSipIn(self):
@ -214,7 +214,7 @@ class TestCheckSipIn(unittest.TestCase):
class TestCheckSipOut(unittest.TestCase):
def setUp(self):
self.ctest = Test()
self.ctest = CTest()
self.msg = load_yaml("./tests/fixtures/sip_out.yml")
def testSipOut(self):
@ -225,7 +225,7 @@ class TestCheckSipOut(unittest.TestCase):
class TestJson(unittest.TestCase):
def setUp(self):
self.ctest = Test()
self.ctest = CTest()
def testFail(self):
check = load_json("./tests/fixtures/fail.json")

Loading…
Cancel
Save