From ccb98cde2e617f155466f85a580c243c78b07013 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Thu, 9 Jul 2020 22:01:25 +0800 Subject: [PATCH] open deccorator test, test=develop (#25464) --- python/paddle/reader/decorator.py | 4 ++++ python/paddle/reader/tests/CMakeLists.txt | 5 +---- python/paddle/reader/tests/decorator_test.py | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/python/paddle/reader/decorator.py b/python/paddle/reader/decorator.py index a81746e4a2c..ff09f4c562a 100644 --- a/python/paddle/reader/decorator.py +++ b/python/paddle/reader/decorator.py @@ -536,6 +536,10 @@ def multiprocess_reader(readers, use_pipe=True, queue_size=1000): """ + if sys.platform == 'win32': + raise NotImplementedError( + "The multiprocess_reader method is not supported on windows.") + try: import ujson as json except Exception as e: diff --git a/python/paddle/reader/tests/CMakeLists.txt b/python/paddle/reader/tests/CMakeLists.txt index b1c2197c405..969718d3b18 100644 --- a/python/paddle/reader/tests/CMakeLists.txt +++ b/python/paddle/reader/tests/CMakeLists.txt @@ -1,4 +1 @@ -# TODO: Fix this unittest failed on Windows -if(NOT WIN32) - py_test(decorator_test SRCS decorator_test.py) -endif() +py_test(decorator_test SRCS decorator_test.py) diff --git a/python/paddle/reader/tests/decorator_test.py b/python/paddle/reader/tests/decorator_test.py index abe87fa04df..e15702e39c4 100644 --- a/python/paddle/reader/tests/decorator_test.py +++ b/python/paddle/reader/tests/decorator_test.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import time import unittest import functools @@ -171,8 +172,9 @@ class TestMultiProcessReader(unittest.TestCase): self.assertEqual(sorted(self.samples), sorted(results)) def test_distributed_batch_reader(self): - self.reader_test(use_pipe=False) - self.reader_test(use_pipe=True) + if sys.platform != 'win32': + self.reader_test(use_pipe=False) + self.reader_test(use_pipe=True) if __name__ == '__main__': -- GitLab