# Clean up any previous test output
for f in pathlib.Path(".").glob("capture_*.log"):
- # have to use .name here since remove() doesn't support passing a
- # PosixPath argument until Python3.6
- os.remove(f.name)
+ os.remove(f)
for d in ("data", "var"):
shutil.rmtree(d, ignore_errors=True)
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
time.sleep(1)
- return(service)
+ return service
def stop_service(service):
# The no-op case when no service was started
if service is None:
- return(success)
+ return success
# This handles when the service is running as a direct child process
service.terminate()
with open("capture_stderr.log", "w") as serviceerr:
serviceerr.write(stderr.decode("utf-8"))
- return(success)
+ return success
def tlog(message, quiet=False):