switch fpdiv/test/test_fp*.py to use unittest
[ieee754fpu.git] / src / ieee754 / fpdiv / test / test_fpdiv_pipe.py
index c0b521b66a5ac3904cc6a3ab7c6b66888af67939..451d979dac7bd48338f8f9ed14ee2c21ff914239 100644 (file)
@@ -4,22 +4,24 @@
 from ieee754.fpdiv.pipeline import (FPDIVMuxInOut,)
 from ieee754.fpcommon.test.fpmux import runfp
 
+import unittest
 from sfpy import Float64, Float32, Float16
 from operator import truediv as div
 
-def test_pipe_div_fp16():
-    dut = FPDIVMuxInOut(16, 4)
-    runfp(dut, 16, "test_fpdiv_pipe_fp16", Float16, div)
 
-def test_pipe_div_fp32():
-    dut = FPDIVMuxInOut(32, 4)
-    runfp(dut, 32, "test_fpdiv_pipe_fp32", Float32, div)
+class TestDivPipe(unittest.TestCase):
+    def test_pipe_div_fp16(self):
+        dut = FPDIVMuxInOut(16, 4)
+        runfp(dut, 16, "test_fpdiv_pipe_fp16", Float16, div)
+
+    def test_pipe_div_fp32(self):
+        dut = FPDIVMuxInOut(32, 4)
+        runfp(dut, 32, "test_fpdiv_pipe_fp32", Float32, div)
+
+    def test_pipe_div_fp64(self):
+        dut = FPDIVMuxInOut(64, 4)
+        runfp(dut, 64, "test_fpdiv_pipe_fp64", Float64, div)
 
-def test_pipe_div_fp64():
-    dut = FPDIVMuxInOut(64, 4)
-    runfp(dut, 64, "test_fpdiv_pipe_fp64", Float64, div)
 
 if __name__ == '__main__':
-    test_pipe_div_fp16()
-    test_pipe_div_fp32()
-    test_pipe_div_fp64()
+    unittest.main()