Skip to content

Commit 35ed73a

Browse files
committed
Reenable TestExecArgs tests
1 parent f4c0d34 commit 35ed73a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bpython/test/test_args.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111

1212
class TestExecArgs(unittest.TestCase):
13-
@unittest.skip("test broken under pytest")
13+
# These tests are currently not very useful. Under pytest neither stdout nor stdin are ttys,
14+
# hence bpython.args.parse will just exectute code by falling back to Python.
15+
1416
def test_exec_dunder_file(self):
1517
with tempfile.NamedTemporaryFile(mode="w") as f:
1618
f.write(
@@ -25,7 +27,7 @@ def test_exec_dunder_file(self):
2527
p = subprocess.Popen(
2628
[sys.executable] + ["-m", "bpython.curtsies", f.name],
2729
stderr=subprocess.PIPE,
28-
universal_newlines=True,
30+
text=True,
2931
)
3032
(_, stderr) = p.communicate()
3133

@@ -36,7 +38,6 @@ def test_exec_nonascii_file(self):
3638
f.write(
3739
dedent(
3840
"""\
39-
#!/usr/bin/env python
4041
# coding: utf-8
4142
"你好 # nonascii"
4243
"""
@@ -50,7 +51,6 @@ def test_exec_nonascii_file(self):
5051
except subprocess.CalledProcessError:
5152
self.fail("Error running module with nonascii characters")
5253

53-
@unittest.skip("test broken under pytest")
5454
def test_exec_nonascii_file_linenums(self):
5555
with tempfile.NamedTemporaryFile(mode="w") as f:
5656
f.write(
@@ -66,7 +66,7 @@ def test_exec_nonascii_file_linenums(self):
6666
p = subprocess.Popen(
6767
[sys.executable, "-m", "bpython.curtsies", f.name],
6868
stderr=subprocess.PIPE,
69-
universal_newlines=True,
69+
text=True,
7070
)
7171
(_, stderr) = p.communicate()
7272

0 commit comments

Comments
 (0)