Fix pre-commit

This commit is contained in:
Chris Kuehl 2021-10-07 11:21:16 -07:00
parent 638e8495c9
commit ba46e1be81
3 changed files with 10 additions and 8 deletions

View file

@ -1,5 +1,3 @@
from __future__ import print_function
import os.path
import subprocess
import tempfile

View file

@ -4,8 +4,6 @@
Since all signals are printed and otherwise ignored, you'll need to send
SIGKILL (kill -9) to this process to actually end it.
"""
from __future__ import print_function
import os
import signal
import sys

View file

@ -1,9 +1,11 @@
import os
import shutil
from subprocess import run, PIPE
from subprocess import PIPE
from subprocess import run
import pytest
@pytest.mark.usefixtures('both_debug_modes', 'both_setsid_modes')
def test_working_directories():
"""The child process must start in the working directory in which
@ -14,9 +16,13 @@ def test_working_directories():
# predictable output - so we can't rely on dumb-init being found
# in the "." directory.
dumb_init = os.path.realpath(shutil.which('dumb-init'))
proc = run((dumb_init,
'sh', '-c', 'readlink /proc/$PPID/cwd && readlink /proc/$$/cwd'),
cwd="/tmp", stdout=PIPE, stderr=PIPE)
proc = run(
(
dumb_init,
'sh', '-c', 'readlink /proc/$PPID/cwd && readlink /proc/$$/cwd',
),
cwd='/tmp', stdout=PIPE, stderr=PIPE,
)
assert proc.returncode == 0
assert proc.stdout == b'/\n/tmp\n'