|
1 | 1 | importsys
|
2 | 2 | importos
|
3 | 3 | importunittest
|
| 4 | +importcStringIO |
| 5 | +importwarnings |
| 6 | + |
4 | 7 | fromsupportimportsimplejson,html5lib_test_files
|
5 | 8 |
|
6 | 9 | fromhtml5lib.tokenizerimportHTMLTokenizer
|
7 | 10 | fromhtml5libimportconstants
|
8 | 11 |
|
9 |
| -importcStringIO |
10 |
| - |
11 | 12 | classTokenizerTestParser(object):
|
12 | 13 | def__init__(self,contentModelFlag,lastStartTag=None):
|
13 | 14 | self.tokenizer=HTMLTokenizer
|
@@ -56,6 +57,7 @@ def processEOF(self, token):
|
56 | 57 | pass
|
57 | 58 |
|
58 | 59 | defprocessParseError(self,token):
|
| 60 | +printtoken |
59 | 61 | self.outputTokens.append([u"ParseError",token["data"]])
|
60 | 62 |
|
61 | 63 | defconcatenateCharacterTokens(tokens):
|
@@ -137,6 +139,14 @@ def buildTestSuite():
|
137 | 139 | testName=os.path.basename(filename).replace(".test","")
|
138 | 140 | if'tests'intests:
|
139 | 141 | forindex,testinenumerate(tests['tests']):
|
| 142 | +#Skip tests with a self closing flag |
| 143 | +skip=False |
| 144 | +fortokenintest["output"]: |
| 145 | +iftoken[0]=="StartTag"andlen(token)==4: |
| 146 | +skip=True |
| 147 | +break |
| 148 | +ifskip: |
| 149 | +continue |
140 | 150 | if'contentModelFlags'notintest:
|
141 | 151 | test["contentModelFlags"]= ["PCDATA"]
|
142 | 152 | forcontentModelFlagintest["contentModelFlags"]:
|
|