Anonymous avatar Anonymous committed d32f03b

Added licensing information for the test framework

Comments (0)

Files changed (5)

 
 The programs in the "doc/examples" subdirectory are in the public domain.
 The documentation generators in the doc/ directory are in the public domain.
+Parts of the test framework in the "test/util" subdirectory are in
+the public domain.
+

test/util/runtests.py

+##
+## This file is placed under the public domain.
+##
+
 import os, sys, traceback
 import unittest
 import optparse
     passed, use the default pygame2 test directory.
     """
     if not testdir:
-        testdir = os.path.join (os.path.dirname (__file__), "..")
+        testdir = os.path.dirname (__file__)
         sys.path.append (testdir)
 
     names = os.listdir (testdir)
         randomizer = random.Random (options.seed)
     loader = testrunner.TagTestLoader (EXCLUDETAGS, randomizer)
 
-    testdir, testfiles = gettestfiles (randomizer=randomizer)
+    testdir, testfiles = gettestfiles \
+        (os.path.join (os.path.dirname (__file__), ".."),
+         randomizer=randomizer)
     testsuites = []
     for test in testfiles:
         testsuites.extend (loadtests (test, testdir, writer, loader, options))

test/util/support.py

+##
+## This file is placed under the public domain.
+##
+
+"""Utility functions for the tests."""
+
 import os, sys
-
 try: 
     import StringIO
 except ImportError:
     import io as StringIO
 
-"""Utility functions for the tests."""
-
-def redirect_output ():
-    """Redirects stderr and stdout into own streams."""
-    yield sys.stderr, sys.stdout
-    sys.stderr, sys.stdout = StringIO.StringIO(), StringIO.StringIO()
-    yield sys.stderr, sys.stdout
-    
-def restore_output (err, out):
-    """Restores stderr and stdout using the passed streams."""
-    sys.stderr, sys.stdout = err, out
-
 class StreamOutput (object):
     def __init__ (self, stream):
         self.stream = stream
             self.stream.write ("%s\r" % data)
         self.curoffset = len (data)
         self.stream.flush ()
+

test/util/testrunner.py

+##
+## This file is placed under the public domain.
+##
+
 import sys, os
 import unittest
 from unittest import TestResult, TestLoader

test/util/testutils.py

-#
-# This file is under the public domain.
-#
+##
+## This file is placed under the public domain.
+##
 
 import os
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.