Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl committed Oct 7, 2021
1 parent 638e849 commit ba46e1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import os.path
import subprocess
import tempfile
Expand Down
2 changes: 0 additions & 2 deletions testing/print_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions tests/cwd_test.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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'

0 comments on commit ba46e1b

Please sign in to comment.