Content-Length: 1956 | pFad | http://github.com/postgrespro/testgres/pull/271.patch
thub.com
From d091eb15f04e6bb957f586f7b8672b3c306bce10 Mon Sep 17 00:00:00 2001
From: vshepard
Date: Tue, 24 Jun 2025 13:54:10 +0200
Subject: [PATCH] Add cwd to ops
---
testgres/operations/local_ops.py | 2 ++
testgres/operations/os_ops.py | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/testgres/operations/local_ops.py b/testgres/operations/local_ops.py
index ccf1ab8..3d1eb33 100644
--- a/testgres/operations/local_ops.py
+++ b/testgres/operations/local_ops.py
@@ -101,6 +101,7 @@ def _run_command__nt(self, cmd, shell, input, stdin, stdout, stderr, get_process
process = subprocess.Popen(
cmd,
shell=shell,
+ cwd=self.cwd,
stdin=stdin or subprocess.PIPE if input is not None else None,
stdout=stdout,
stderr=stderr,
@@ -151,6 +152,7 @@ def _run_command__generic(self, cmd, shell, input, stdin, stdout, stderr, get_pr
process = subprocess.Popen(
cmd,
shell=shell,
+ cwd=self.cwd,
stdin=stdin or subprocess.PIPE if input is not None else None,
stdout=stdout or subprocess.PIPE,
stderr=stderr or subprocess.PIPE,
diff --git a/testgres/operations/os_ops.py b/testgres/operations/os_ops.py
index 45e4f71..85709d3 100644
--- a/testgres/operations/os_ops.py
+++ b/testgres/operations/os_ops.py
@@ -1,5 +1,6 @@
import getpass
import locale
+import os
class ConnectionParams:
@@ -18,6 +19,7 @@ def get_default_encoding():
class OsOperations:
def __init__(self, username=None):
+ self.cwd = os.getcwd()
self.ssh_key = None
self.username = username or getpass.getuser()
@@ -133,3 +135,7 @@ def is_port_free(self, number: int):
def get_tempdir(self) -> str:
raise NotImplementedError()
+
+ def set_cwd(self, cwd):
+ if cwd:
+ self.cwd = cwd
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/postgrespro/testgres/pull/271.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy