mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Move shared fixtures and constants to files
This commit is contained in:
24
tests/interop/conftest.py
Normal file
24
tests/interop/conftest.py
Normal file
@ -0,0 +1,24 @@
|
||||
import sys
|
||||
|
||||
import pexpect
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def proc_factory():
|
||||
procs = []
|
||||
|
||||
def call_proc(cmd, args, logfile=None, encoding=None):
|
||||
if logfile is None:
|
||||
logfile = sys.stdout
|
||||
if encoding is None:
|
||||
encoding = "utf-8"
|
||||
proc = pexpect.spawn(cmd, args, logfile=logfile, encoding=encoding)
|
||||
procs.append(proc)
|
||||
return proc
|
||||
|
||||
try:
|
||||
yield call_proc
|
||||
finally:
|
||||
for proc in procs:
|
||||
proc.close()
|
||||
Reference in New Issue
Block a user