diff tests/test_processing_base.py @ 492:d90ccdf18156

tests: Fix processing tests on Windows. See the comment in `pipeline.py` for more info but basically I was passing already initialized processors to the worker pool, which means pickling the whole app. Pretty bad. Interesting that it only broke on Windows, though.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 23 Jul 2015 22:07:32 -0700
parents c4b3a7fd2f87
children c9c305645e5f
line wrap: on
line diff
--- a/tests/test_processing_base.py	Wed Jul 22 22:21:42 2015 -0700
+++ b/tests/test_processing_base.py	Thu Jul 23 22:07:32 2015 -0700
@@ -97,7 +97,8 @@
     with mock_fs_scope(fs):
         pp = _get_pipeline(fs)
         pp.enabled_processors = ['copy']
-        pp.additional_processors = [FooProcessor(('foo', 'bar'))]
+        pp.additional_processors_factories = [
+                lambda: FooProcessor(('foo', 'bar'))]
         pp.run()
         expected = {'blah.bar': 'FOO: A test file.'}
         assert expected == fs.getStructure('counter')
@@ -145,9 +146,9 @@
             .withFile('kitchen/assets/blah.foo', 'A test file.'))
     with mock_fs_scope(fs):
         pp = _get_pipeline(fs)
-        noop = NoopProcessor(('foo', 'foo'))
         pp.enabled_processors = ['copy']
-        pp.additional_processors = [noop]
+        pp.additional_processors_factories = [
+                lambda: NoopProcessor(('foo', 'foo'))]
         pp.run()
         assert os.path.exists(fs.path('/counter/blah.foo')) is True
         mtime = os.path.getmtime(fs.path('/counter/blah.foo'))