Skip to content

Commit 2f4df51

Browse files
committed
Fix test with newer Python
File .write() methods now return a number, which was displayed in the notebook and messing up the tests. Use print() instead to avoid this.
1 parent 1397af8 commit 2f4df51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_ignore.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def test_conf_ignore_stderr(testdir):
2323
# Setup notebook with stream outputs
2424
nb = build_nb([
2525
"import sys",
26-
"sys.stdout.write('test\\n')",
27-
"sys.stderr.write('error output\\n')",
28-
"sys.stdout.write('test\\n')\nsys.stderr.write('error output\\n')",
26+
"print('test')",
27+
"print('error output', file=sys.stderr)",
28+
"print('test')\nprint('error output', file=sys.stderr)",
2929
], mark_run=True)
3030
nb.cells[1].outputs.append(nbformat.v4.new_output(
3131
'stream',

0 commit comments

Comments
 (0)