From 7e3e1c1ece9173b10b2e89848f814d0c346a869d Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 11 Oct 2000 21:26:03 +0000 Subject: [PATCH] Added test cases for extended printing to an instance. This picked up a bug in JPython where the instance had to have a flush() method. --- Lib/test/test_grammar.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 68cae81f507..0ca5a4671e7 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -268,10 +268,18 @@ def d22v(a, b, c=1, d=2, *rest): pass print >> sys.stdout, 0 or 1, 0 or 1, print >> sys.stdout, 0 or 1 -# test print >> None +# test printing to an instance class Gulp: def write(self, msg): pass +gulp = Gulp() +print >> gulp, 1, 2, 3 +print >> gulp, 1, 2, 3, +print >> gulp +print >> gulp, 0 or 1, 0 or 1, +print >> gulp, 0 or 1 + +# test print >> None def driver(): oldstdout = sys.stdout sys.stdout = Gulp()