Fixing more tests using multiprocessing on Windows
This commit is contained in:
parent
04be5f1180
commit
05038116f0
|
@ -358,6 +358,8 @@ class MultiProcessTaskExecutor(TaskExecutor):
|
|||
"""
|
||||
super(MultiProcessTaskExecutor, self).__init__(*args, **kwargs)
|
||||
self.worker_count = worker_count
|
||||
self._waiting_deferreds = {}
|
||||
|
||||
try:
|
||||
self._pool = multiprocessing.Pool(processes=self.worker_count,
|
||||
initializer=_task_initializer)
|
||||
|
@ -369,7 +371,6 @@ class MultiProcessTaskExecutor(TaskExecutor):
|
|||
'workaround. Boo!')
|
||||
print 'Try running with -j1 to disable multiprocessing'
|
||||
raise
|
||||
self._waiting_deferreds = {}
|
||||
|
||||
def run_task_async(self, task):
|
||||
if self.closed:
|
||||
|
|
|
@ -144,7 +144,7 @@ class WhichTest(unittest2.TestCase):
|
|||
self.assertIsNotNone(util.which('notepad.exe'))
|
||||
|
||||
@unittest2.skipIf(sys.platform.startswith('win'), 'platform')
|
||||
def testLinux(self):
|
||||
def testUnix(self):
|
||||
self.assertEqual(util.which('/bin/sh'), '/bin/sh')
|
||||
self.assertIsNone(util.which('xxx'))
|
||||
self.assertIsNotNone(util.which('cat'))
|
||||
|
|
|
@ -13,9 +13,15 @@ __author__ = 'benvanik@google.com (Ben Vanik)'
|
|||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
# Add self to the root search path
|
||||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
|
||||
|
||||
# Run the tests
|
||||
import anvil.test
|
||||
anvil.test.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue