复制代码def test_nan_to_none(self): self.assertIsNone(nan_to_none(nan)) self.assertEqual(1, nan_to_none(1))