summaryrefslogtreecommitdiff
path: root/unittests/baseplatformtests.py
diff options
context:
space:
mode:
authorDan Hawson <18214721+GertyP@users.noreply.github.com>2023-07-29 14:47:08 +0100
committerEli Schwartz <eschwartz@archlinux.org>2023-07-31 15:43:28 -0400
commit7c955618dd46c3ea7dc221bdf60354871f17f39d (patch)
treeb78df53cddd0c19e77320c2200173d583926f2ff /unittests/baseplatformtests.py
parentd4615369ffbfc0f9a769ca1fd3566056cfa5ef81 (diff)
downloadmeson-7c955618dd46c3ea7dc221bdf60354871f17f39d.tar.gz
Rename variables that clash with pdb commands
By default, pdb assumes that any command run is python code to be evaluated, but only if that code isn't a builtin pdb command. You can force it to be evaluated as python code by prefixing it with `!`. It's handy to simply name a python variable and have its variable be printed. But single letter variables like 's' and 'p' make debugging with pdb commands (i.e. 's'tep, and 'p'rint evaluated expressions) less convenient, and potentially confusing.
Diffstat (limited to 'unittests/baseplatformtests.py')
-rw-r--r--unittests/baseplatformtests.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py
index 4b16e7d82..3008eb731 100644
--- a/unittests/baseplatformtests.py
+++ b/unittests/baseplatformtests.py
@@ -171,22 +171,22 @@ class BasePlatformTests(TestCase):
env = os.environ.copy()
env.update(override_envvars)
- p = subprocess.run(command, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT if stderr else subprocess.PIPE,
- env=env,
- encoding='utf-8',
- text=True, cwd=workdir, timeout=60 * 5)
+ proc = subprocess.run(command, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT if stderr else subprocess.PIPE,
+ env=env,
+ encoding='utf-8',
+ text=True, cwd=workdir, timeout=60 * 5)
print('$', join_args(command))
print('stdout:')
- print(p.stdout)
+ print(proc.stdout)
if not stderr:
print('stderr:')
- print(p.stderr)
- if p.returncode != 0:
- if 'MESON_SKIP_TEST' in p.stdout:
+ print(proc.stderr)
+ if proc.returncode != 0:
+ if 'MESON_SKIP_TEST' in proc.stdout:
raise SkipTest('Project requested skipping.')
- raise subprocess.CalledProcessError(p.returncode, command, output=p.stdout)
- return p.stdout
+ raise subprocess.CalledProcessError(proc.returncode, command, output=proc.stdout)
+ return proc.stdout
def init(self, srcdir, *,
extra_args=None,