8000 Some cleanup for 0.10 · Roverok/html5lib-python@15eebd3 · GitHub
[go: up one dir, main page]

Skip to content

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

Appearance settings

Commit 15eebd3

Browse files
committed
Some cleanup for 0.10
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401025
1 parent f8e251a commit 15eebd3

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/html5lib/filters/formfiller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __iter__(self):
7070

7171
elif name == "select":
7272
field_type = "select"
73-
attributes = dict(reversed(token["data"]))
73+
attributes = dict(token["data"][::-1])
7474
field_name = attributes.get("name")
7575
is_select_multiple = "multiple" in attributes
7676
is_selected_option_found = False

tests/runtests.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
os.chdir(os.path.split(os.path.abspath(__file__))[0])
88
sys.path.insert(0, os.path.abspath(os.curdir))
99
sys.path.insert(0, os.path.abspath(os.pardir))
10-
10+
sys.path.insert(0, os.path.join(os.path.abspath(os.pardir), "src"))
1111

1212
def buildTestSuite():
1313
suite = unittest.TestSuite()
@@ -18,7 +18,9 @@ def buildTestSuite():
1818

1919
def main():
2020
results = unittest.TextTestRunner().run(buildTestSuite())
21-
if not results.wasSuccessful(): sys.exit(1)
21+
return results
2222

2323
if __name__ == "__main__":
24-
main()
24+
results = main()
25+
if not results.wasSuccessful():
26+
sys.exit(1)

tests/test_encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def encodingTest(self, data=test['data'], encoding=test['encoding']):
2323
try:
2424
import chardet
2525
def test_chardet(self):
26-
data = open(os.path.join(test_dir, "/chardet/test_big5.txt")).read()
26+
data = open(os.path.join(test_dir, "encoding" , "chardet", "test_big5.txt")).read()
2727
encoding = inputstream.HTMLInputStream(data).charEncoding
2828
assert encoding.lower() == "big5"
2929
setattr(Html5EncodingTestCase, 'test_chardet', test_chardet)

utils/package.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
import subprocess
88
import zipfile
99

10-
exclude = [".svn", "*.pyc", "*~", "__basedir__/utils",
10+
exclude = [".svn", "*.pyc", "*~", "*.orig", "*.patch", "__basedir__/utils",
1111
"__basedir__/setup_base.py", "*.prof", "#*", "__basedir__/build",
1212
'__basedir__/tests/performance', '*.out',
13-
'__basedir__/tests/sites', '__basedir__/tests/*.html']
13+
'__basedir__/tests/testdata/*.html',
14+
'__basedir__/tests/testdata/sites', '__basedir__/print-stats.py']
1415

1516
class Package(object):
1617

0 commit comments

Comments
 (0)
0