From 6e5034e248d4651bb39b0cf8602e26c180388d00 Mon Sep 17 00:00:00 2001 From: pangyoki Date: Wed, 14 Oct 2020 20:47:46 +0800 Subject: [PATCH] fix test directory migration (#27885) * fix test directory migration * change assert to self.assertXXX --- .../fluid/tests/unittests/test_directory_migration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_directory_migration.py b/python/paddle/fluid/tests/unittests/test_directory_migration.py index 9dbbdeee314..3e0c52b7be8 100644 --- a/python/paddle/fluid/tests/unittests/test_directory_migration.py +++ b/python/paddle/fluid/tests/unittests/test_directory_migration.py @@ -94,8 +94,8 @@ class TestDirectory(unittest.TestCase): stderr=subprocess.PIPE) stdout, stderr = ps_proc.communicate() - assert "Error" not in str(stderr), "Error: Can't" \ - " import Module {}".format(module) + self.assertFalse("Error" in str(stderr), + "ErrorMessage:\n{}".format(bytes.decode(stderr))) def test_old_directory(self): old_directory = [ @@ -177,7 +177,7 @@ if count != {len_old_directory}: stderr=subprocess.PIPE) stdout, stderr = ps_proc.communicate() - assert "Error" not in str(stdout), str(stdout) + self.assertFalse("Error" in str(stdout), bytes.decode(stdout)) if __name__ == '__main__': -- GitLab