Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc66d41e

Browse files
committed
Use the nose skip plugin to actually properly skip tests.
1 parent5ef00b1 commitc66d41e

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

‎html5lib/tests/support.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
importglob
77
importxml.sax.handler
88

9+
fromnose.plugins.skipimportSkipTest
10+
911
base_path=os.path.split(__file__)[0]
1012

1113
test_dir=os.path.join(base_path,'testdata')
@@ -182,6 +184,8 @@ def xfail(test):
182184
deft(*args,**kwargs):
183185
try:
184186
test(*args)
187+
exceptSkipTest:
188+
raise
185189
except:
186190
return
187191
else:

‎html5lib/tests/test_encoding.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
exceptAttributeError:
99
unittest.TestCase.assertEqual=unittest.TestCase.assertEquals
1010

11+
fromnose.plugins.skipimportSkipTest
12+
1113
from .supportimportget_data_files,TestData,test_dir,errorMessage
1214
fromhtml5libimportHTMLParser,inputstream
1315

@@ -41,7 +43,7 @@ def runPreScanEncodingTest(data, encoding):
4143

4244
# Very crude way to ignore irrelevant tests
4345
iflen(data)>stream.numBytesMeta:
44-
return
46+
raiseSkipTest()
4547

4648
assertencoding==stream.charEncoding[0],errorMessage(data,encoding,stream.charEncoding[0])
4749

‎html5lib/tests/test_parser.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
warnings.simplefilter("error")
1010

11+
fromnose.plugins.skipimportSkipTest
12+
1113
from .supportimportget_data_files
1214
from .supportimportTestData,convert,convertExpected,treeTypes
1315
from .supportimportxfail
@@ -30,7 +32,7 @@ def runParserTest(innerHTML, input, expected, errors, treeClass,
3032
namespaceHTMLElements,scriptingDisabled):
3133
ifscriptingDisabled:
3234
# We don't support the scripting disabled case!
33-
return
35+
raiseSkipTest()
3436

3537
withwarnings.catch_warnings(record=True)ascaughtWarnings:
3638
warnings.simplefilter("always")
@@ -51,7 +53,7 @@ def runParserTest(innerHTML, input, expected, errors, treeClass,
5153
ifnotissubclass(x.category,constants.DataLossWarning)]
5254
assertlen(otherWarnings)==0, [(x.category,x.message)forxinotherWarnings]
5355
iflen(caughtWarnings):
54-
return
56+
raiseSkipTest()
5557

5658
output=convertTreeDump(p.tree.testSerializer(document))
5759

‎html5lib/tests/test_treewalkers.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
exceptAttributeError:
1212
unittest.TestCase.assertEqual=unittest.TestCase.assertEquals
1313

14+
fromnose.plugins.skipimportSkipTest
15+
1416
from .supportimportget_data_files,TestData,convertExpected,xfail
1517

1618
fromhtml5libimporthtml5parser,treewalkers,treebuilders,constants
@@ -253,7 +255,7 @@ def test_all_tokens(self):
253255
defrunTreewalkerTest(innerHTML,input,expected,errors,treeClass,scriptingDisabled):
254256
ifscriptingDisabled:
255257
# We don't support the scripting disabled case!
256-
return
258+
raiseSkipTest()
257259

258260
warnings.resetwarnings()
259261
warnings.simplefilter("error")
@@ -265,7 +267,7 @@ def runTreewalkerTest(innerHTML, input, expected, errors, treeClass, scriptingDi
265267
document=p.parse(input)
266268
exceptconstants.DataLossWarning:
267269
# Ignore testcases we know we don't pass
268-
return
270+
raiseSkipTest()
269271

270272
document=treeClass.get("adapter",lambdax:x)(document)
271273
try:
@@ -282,7 +284,7 @@ def runTreewalkerTest(innerHTML, input, expected, errors, treeClass, scriptingDi
282284
"","Diff:",diff,
283285
])
284286
exceptNotImplementedError:
285-
pass# Amnesty for those that confess...
287+
raiseSkipTest()# Amnesty for those that confess...
286288

287289

288290
@xfail

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp