|
1 |
| -# Copyright (c) 2018, 2023, Oracle and/or its affiliates. |
| 1 | +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. |
2 | 2 | # Copyright (C) 1996-2017 Python Software Foundation
|
3 | 3 | #
|
4 | 4 | # Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
@@ -144,39 +144,39 @@ def test_graal_python_args(self):
|
144 | 144 |
|
145 | 145 | env = {"GRAAL_PYTHON_ARGS": "-c 12"}
|
146 | 146 | result = subprocess.run([sys.executable], env=env)
|
147 |
| - assert result.returncode == 0 |
| 147 | + self.assertEqual(0, result.returncode) |
148 | 148 |
|
149 | 149 | env = {"GRAAL_PYTHON_ARGS": "-c 'print(12)'"}
|
150 | 150 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
151 |
| - assert result == '12\n' |
| 151 | + self.assertEqual('12\n', result) |
152 | 152 |
|
153 | 153 | env = {"GRAAL_PYTHON_ARGS": """-c 'print("Hello world")'"""}
|
154 | 154 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
155 |
| - assert result == 'Hello world\n' |
| 155 | + self.assertEqual('Hello world\n', result) |
156 | 156 |
|
157 | 157 | env = {"GRAAL_PYTHON_ARGS": """-c ""'print("Hello world")'"""""}
|
158 | 158 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
159 |
| - assert result == 'Hello world\n' |
| 159 | + self.assertEqual('Hello world\n', result) |
160 | 160 |
|
161 | 161 | env = {"GRAAL_PYTHON_ARGS": r"""-c 'print(\'"Hello world"\')'"""""}
|
162 | 162 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
163 |
| - assert result == '"Hello world"\n' |
| 163 | + self.assertEqual('"Hello world"\n', result) |
164 | 164 |
|
165 | 165 | env = {"GRAAL_PYTHON_ARGS": """\v-c\vprint('"Hello world"')"""}
|
166 | 166 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
167 |
| - assert result == '"Hello world"\n' |
| 167 | + self.assertEqual('"Hello world"\n', result) |
168 | 168 |
|
169 | 169 | env = {"GRAAL_PYTHON_ARGS": """\v-c\vprint('Hello', "world")"""}
|
170 | 170 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
171 |
| - assert result == 'Hello world\n' |
| 171 | + self.assertEqual('Hello world\n', result) |
172 | 172 |
|
173 | 173 | # check that the subprocess receives the args and thus it should fail because it recurses
|
174 | 174 | args = """\v-c\vimport os\nprint(os.environ.get("GRAAL_PYTHON_ARGS"))"""
|
175 | 175 | env = {"GRAAL_PYTHON_ARGS": args}
|
176 | 176 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
177 |
| - assert result == f"{args}\n" |
| 177 | + self.assertEqual(f"{args}\n", result) |
178 | 178 |
|
179 | 179 | # check that the subprocess does not receive the args when we end with \v
|
180 | 180 | env = {"GRAAL_PYTHON_ARGS": """\v-c\vimport os\nprint(os.environ.get("GRAAL_PYTHON_ARGS"))\v"""}
|
181 | 181 | result = subprocess.check_output([sys.executable], env=env, text=True)
|
182 |
| - assert result == 'None\n' |
| 182 | + self.assertEqual('None\n', result) |
0 commit comments