summaryrefslogtreecommitdiffhomepage
path: root/test/unit
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2020-03-06 20:08:38 +0300
committerValentin Bartenev <vbart@nginx.com>2020-03-06 20:08:38 +0300
commit810b8dbb6798bd8ddcbafae7ecd9e5ee535c92f4 (patch)
treef50054ee314057a257f134a57d551fd60d5941eb /test/unit
parent3617d4ed03326239587b7299370e64669533c6f5 (diff)
downloadunit-810b8dbb6798bd8ddcbafae7ecd9e5ee535c92f4.tar.gz
unit-810b8dbb6798bd8ddcbafae7ecd9e5ee535c92f4.tar.bz2
Tests: unitd stderr output redirected to unit.log.
A part of the debug log was printed to stderr before the log file was opened. Now, this output is redirected to the same log file.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/main.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/unit/main.py b/test/unit/main.py
index 322066ba..a7981c1c 100644
--- a/test/unit/main.py
+++ b/test/unit/main.py
@@ -209,19 +209,19 @@ class TestUnit(unittest.TestCase):
os.mkdir(self.testdir + '/state')
- print()
-
- self._p = subprocess.Popen(
- [
- self.unitd,
- '--no-daemon',
- '--modules', self.pardir + '/build',
- '--state', self.testdir + '/state',
- '--pid', self.testdir + '/unit.pid',
- '--log', self.testdir + '/unit.log',
- '--control', 'unix:' + self.testdir + '/control.unit.sock',
- ]
- )
+ with open(self.testdir + '/unit.log', 'w') as log:
+ self._p = subprocess.Popen(
+ [
+ self.unitd,
+ '--no-daemon',
+ '--modules', self.pardir + '/build',
+ '--state', self.testdir + '/state',
+ '--pid', self.testdir + '/unit.pid',
+ '--log', self.testdir + '/unit.log',
+ '--control', 'unix:' + self.testdir + '/control.unit.sock',
+ ],
+ stderr=log,
+ )
if not self.waitforfiles(self.testdir + '/control.unit.sock'):
exit("Could not start unit")