Commit 844ebdbc by Chris Jerdonek

Cleaned up code comments in previous commit.

parent 6252e693
...@@ -11,16 +11,18 @@ FILE_ENCODING = 'utf-8' # the encoding of the spec test files. ...@@ -11,16 +11,18 @@ FILE_ENCODING = 'utf-8' # the encoding of the spec test files.
try: try:
# We try yaml first since it is more convenient when adding and modifying
# test cases by hand (since the YAML is human-readable and is the master
# from which the JSON format is generated).
import yaml import yaml
except ImportError: except ImportError:
try: try:
# We use the JSON files rather than the YAML files because json libraries
# are available for Python 2.4.
import json import json
except: except:
# The module json is not available prior to Python 2.6, whereas simplejson is. # The module json is not available prior to Python 2.6, whereas
# Note that simplejson dropped support for Python 2.4 in simplejson v2.1.0, # simplejson is. The simplejson package dropped support for Python 2.4
# so Python 2.4 requires a simplejson install older than the most recent. # in simplejson v2.1.0, so Python 2.4 requires a simplejson install
# older than the most recent version.
import simplejson as json import simplejson as json
file_extension = 'json' file_extension = 'json'
parser = json parser = json
...@@ -48,7 +50,7 @@ def parse(u, file_extension): ...@@ -48,7 +50,7 @@ def parse(u, file_extension):
u: a unicode string. u: a unicode string.
""" """
# Find a cleaner mechanism for choosing between the two. # TODO: find a cleaner mechanism for choosing between the two.
if file_extension[0] == 'j': if file_extension[0] == 'j':
# Then json. # Then json.
...@@ -75,7 +77,6 @@ def parse(u, file_extension): ...@@ -75,7 +77,6 @@ def parse(u, file_extension):
return yaml.load(u) return yaml.load(u)
# This test case lets us alert the user that spec tests are missing. # This test case lets us alert the user that spec tests are missing.
class CheckSpecTestsFound(unittest.TestCase): class CheckSpecTestsFound(unittest.TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment