summaryrefslogtreecommitdiff
path: root/docutils/test
diff options
context:
space:
mode:
authorgrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2008-11-30 09:46:40 +0000
committergrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2008-11-30 09:46:40 +0000
commitc66abd1acccfb76dc9817a2372ba359a7eaba47f (patch)
tree476b3903bca219065d23329b0669b72220b1cfd4 /docutils/test
parent5d56fddcbcb6f944fbc9e79ba209090586ebb4c5 (diff)
downloaddocutils-c66abd1acccfb76dc9817a2372ba359a7eaba47f.tar.gz
Prepare for python 3.0: use os.walk instead os.path.walk.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5739 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
-rwxr-xr-xdocutils/test/test_functional.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/docutils/test/test_functional.py b/docutils/test/test_functional.py
index d2dff949d..91e1f5f40 100755
--- a/docutils/test/test_functional.py
+++ b/docutils/test/test_functional.py
@@ -39,7 +39,19 @@ class FunctionalTestSuite(DocutilsTestSupport.CustomTestSuite):
os.chdir(DocutilsTestSupport.testroot)
self.clear_output_directory()
self.added = 0
- os.path.walk(join_path(datadir, 'tests'), self.walker, None)
+ try:
+ for root, dirs, files in os.walk(join_path(datadir, 'tests')):
+ # Process all config files among `names` in `dirname`. A config
+ # file is a Python file (*.py) which sets several variables.
+ for name in files:
+ if name.endswith('.py') and not name.startswith('_'):
+ config_file_full_path = join_path(root, name)
+ self.addTestCase(FunctionalTestCase, 'test', None, None,
+ id=config_file_full_path,
+ configfile=config_file_full_path)
+ self.added += 1
+ except (AttributeError): # python2.2 does not have os.walk
+ os.path.walk(join_path(datadir, 'tests'), self.walker, None)
assert self.added, 'No functional tests found.'
def clear_output_directory(self):