summaryrefslogtreecommitdiffhomepage
path: root/test/unit/main.py
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-02-04 11:39:34 +0300
committerMax Romanov <max.romanov@nginx.com>2020-02-04 11:39:34 +0300
commit81b39d0b35d78daabf479ccd492ae8323039b7cb (patch)
tree53708f86c3e46dc9813aaf56d38cbe2fb486c0c8 /test/unit/main.py
parent7c38650cd12b9d5b14aec5d416fa3b57918cee50 (diff)
downloadunit-81b39d0b35d78daabf479ccd492ae8323039b7cb.tar.gz
unit-81b39d0b35d78daabf479ccd492ae8323039b7cb.tar.bz2
Tests: fixing Python 3.8.1 errors on Mac.
- "Can't pickle local object ..." - "if __name__ == '__main__':" pattern required for multiprocessing
Diffstat (limited to '')
-rw-r--r--test/unit/main.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/test/unit/main.py b/test/unit/main.py
index ea6afd7f..37d01d3b 100644
--- a/test/unit/main.py
+++ b/test/unit/main.py
@@ -209,9 +209,7 @@ class TestUnit(unittest.TestCase):
print()
- def _run_unit():
- subprocess.call(
- [
+ self._p = Process(target=subprocess.call, args=[ [
self.unitd,
'--no-daemon',
'--modules', self.pardir + '/build',
@@ -219,10 +217,7 @@ class TestUnit(unittest.TestCase):
'--pid', self.testdir + '/unit.pid',
'--log', self.testdir + '/unit.log',
'--control', 'unix:' + self.testdir + '/control.unit.sock',
- ]
- )
-
- self._p = Process(target=_run_unit)
+ ] ])
self._p.start()
if not self.waitforfiles(
@@ -299,11 +294,11 @@ class TestUnit(unittest.TestCase):
if found:
print('skipped.')
- def run_process(self, target):
+ def run_process(self, target, *args):
if not hasattr(self, '_processes'):
self._processes = []
- process = Process(target=target)
+ process = Process(target=target, args=args)
process.start()
self._processes.append(process)