Skip to content

Commit

Permalink
tests: test universal_newlines in test_run_in_text_mode
Browse files Browse the repository at this point in the history
'text' is just an alias for 'universal_newlines' so we should test that
as well to cover older Python versions.
  • Loading branch information
lzaoral committed Aug 23, 2023
1 parent 507ae22 commit d83474b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def test_run(self):
run("echo foo | tee >(md5sum -b) >/dev/null", executable="/bin/bash")

def test_run_in_text_mode(self):
"""test run with kwargs 'text', 'encoding' or/and 'errors' set.
"""test run with kwargs 'text', 'encoding', 'universal_newlines' or/and
'errors' set.
Python 3.7 added 'text' as an alias for 'universal_newlines'.
"""
Expand All @@ -187,6 +188,9 @@ def test_run_in_text_mode(self):
self.assertEqual(ret, 0)
self.assertEqual(out, "hello\n")

ret, out = run("echo hello", universal_newlines=True)
self.assertEqual(ret, 0)
self.assertEqual(out, "hello\n")

ret, out = run("echo hello", encoding="utf-8")
self.assertEqual(ret, 0)
Expand Down

0 comments on commit d83474b

Please sign in to comment.