From 8a4e67a1ae94851c15dcf414d6a4b3e620d8a8b8 Mon Sep 17 00:00:00 2001 From: Zhou Wei <1183042833@qq.com> Date: Tue, 27 Dec 2022 21:07:02 +0800 Subject: [PATCH] fux bug of UT test_version (#49349) --- .../paddle/fluid/tests/unittests/test_version.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_version.py b/python/paddle/fluid/tests/unittests/test_version.py index f19136554aa..55b5228882b 100644 --- a/python/paddle/fluid/tests/unittests/test_version.py +++ b/python/paddle/fluid/tests/unittests/test_version.py @@ -34,12 +34,6 @@ class VersionTest(unittest.TestCase): # check version format if fluid_version.istaged: - self.assertEqual(fluid_version.major, 0) - self.assertEqual(fluid_version.minor, 0) - self.assertEqual(fluid_version.patch, "0") - self.assertEqual(fluid_version.rc, 0) - self.assertEqual(fluid_version.full_version, "0.0.0") - else: self.assertTrue(re.match(self._major_regex, fluid_version.major)) self.assertTrue(re.match(self._minor_regex, fluid_version.minor)) self.assertTrue(re.match(self._patch_regex, fluid_version.patch)) @@ -47,3 +41,13 @@ class VersionTest(unittest.TestCase): self.assertTrue( re.match(self._version_regex, fluid_version.full_version) ) + else: + self.assertEqual(fluid_version.major, "0") + self.assertEqual(fluid_version.minor, "0") + self.assertEqual(fluid_version.patch, "0") + self.assertEqual(fluid_version.rc, "0") + self.assertEqual(fluid_version.full_version, "0.0.0") + + +if __name__ == '__main__': + unittest.main() -- GitLab