]> granicus.if.org Git - python/commitdiff
Added test cases for extended printing to an instance. This picked up
authorBarry Warsaw <barry@python.org>
Wed, 11 Oct 2000 21:26:03 +0000 (21:26 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 11 Oct 2000 21:26:03 +0000 (21:26 +0000)
a bug in JPython where the instance had to have a flush() method.

Lib/test/test_grammar.py

index 68cae81f5076f4076ba05e651ddd888121a2dae6..0ca5a4671e750b0f8ea04168c72661ff9af78f5e 100644 (file)
@@ -268,10 +268,18 @@ print >> sys.stdout
 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()