Skip to content

Commit

Permalink
[tests] Update os import
Browse files Browse the repository at this point in the history
  • Loading branch information
tysmith committed Apr 24, 2023
1 parent 0254fbb commit cef9386
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ffpuppet/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""ffpuppet helpers tests"""

import os
from multiprocessing import Event, Process
from os import getpid
from pathlib import Path
from platform import system
from subprocess import CalledProcessError
Expand Down Expand Up @@ -229,21 +229,21 @@ def test_helpers_04(mocker, tmp_path):
# this needs to be here in order to work correctly on Windows
def _dummy_process(is_alive, is_done):
is_alive.set()
print(f"I'm process {os.getpid()}\n")
print(f"I'm process {getpid()}\n")
is_done.wait(30)


def test_helpers_05():
"""test get_processes()"""
assert len(list(get_processes(os.getpid(), recursive=False))) == 1
assert len(list(get_processes(getpid(), recursive=False))) == 1
assert not any(get_processes(0xFFFFFF))
is_alive = Event()
is_done = Event()
proc = Process(target=_dummy_process, args=(is_alive, is_done))
proc.start()
try:
is_alive.wait(30)
assert len(list(get_processes(os.getpid()))) > 1
assert len(list(get_processes(getpid()))) > 1
finally:
is_done.set()
proc.join()
Expand Down

0 comments on commit cef9386

Please sign in to comment.