Skip to content

Commit a0a5cf3

Browse files
committed
fix: add tests for the change
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent 738d41e commit a0a5cf3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_pyrepl/test_unix_console.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,13 @@ def test_getheightwidth_with_invalid_environ(self, _os_write):
303303
self.assertIsInstance(console.getheightwidth(), tuple)
304304
os.environ = []
305305
self.assertIsInstance(console.getheightwidth(), tuple)
306+
307+
def test_mac_with_invalid_environ(self, _os_write):
308+
# gh-128636 for macOS
309+
if sys.platform == "darwin":
310+
console = UnixConsole(term="xterm")
311+
with os_helper.EnvironmentVarGuard() as env:
312+
env["TERM_PROGRAM"] = "Apple_Terminal"
313+
console.is_mac = True
314+
os.environ = []
315+
self.assertIsInstance(console.getheightwidth(), tuple)

0 commit comments

Comments
 (0)