@@ -1,5 +1,6 @@ | |||||
v0.6 (unreleased): | v0.6 (unreleased): | ||||
- Dropped support for end-of-life Python versions 2.6, 3.2, 3.3. (#199, #204) | |||||
- Fixed <wbr> not being considered a single-only tag. (#200) | - Fixed <wbr> not being considered a single-only tag. (#200) | ||||
v0.5.1 (released March 3, 2018): | v0.5.1 (released March 3, 2018): | ||||
@@ -7,6 +7,9 @@ v0.6 | |||||
Unreleased | Unreleased | ||||
(`changes <https://github.com/earwig/mwparserfromhell/compare/v0.5.1...develop>`__): | (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.5.1...develop>`__): | ||||
- Dropped support for end-of-life Python versions 2.6, 3.2, 3.3. | |||||
(`#199 <https://github.com/earwig/mwparserfromhell/issues/199>`, | |||||
`#204 <https://github.com/earwig/mwparserfromhell/pull/204>`) | |||||
- Fixed `<wbr>` not being considered a single-only tag. | - Fixed `<wbr>` not being considered a single-only tag. | ||||
(`#200 <https://github.com/earwig/mwparserfromhell/pull/200>`) | (`#200 <https://github.com/earwig/mwparserfromhell/pull/200>`) | ||||
@@ -76,13 +76,13 @@ if fallback: | |||||
tokenizer = Extension("mwparserfromhell.parser._tokenizer", | tokenizer = Extension("mwparserfromhell.parser._tokenizer", | ||||
sources=sorted(glob("mwparserfromhell/parser/ctokenizer/*.c")), | sources=sorted(glob("mwparserfromhell/parser/ctokenizer/*.c")), | ||||
depends=glob("mwparserfromhell/parser/ctokenizer/*.h")) | |||||
depends=sorted(glob("mwparserfromhell/parser/ctokenizer/*.h"))) | |||||
setup( | setup( | ||||
name = "mwparserfromhell", | name = "mwparserfromhell", | ||||
packages = find_packages(exclude=("tests",)), | packages = find_packages(exclude=("tests",)), | ||||
ext_modules = [tokenizer] if use_extension else [], | ext_modules = [tokenizer] if use_extension else [], | ||||
test_suite = "tests.discover", | |||||
test_suite = "tests", | |||||
version = __version__, | version = __version__, | ||||
author = "Ben Kurtovic", | author = "Ben Kurtovic", | ||||
author_email = "ben.kurtovic@gmail.com", | author_email = "ben.kurtovic@gmail.com", | ||||
@@ -109,7 +109,7 @@ class TokenizerTestCase(object): | |||||
print(error.format(filename)) | print(error.format(filename)) | ||||
continue | continue | ||||
if data["input"] is None or data["output"] is None: | if data["input"] is None or data["output"] is None: | ||||
error = "Test '{0}' in '{1}' was ignored because it lacked an input or an output" | |||||
error = "Test '{}' in '{}' was ignored because it lacked an input or an output" | |||||
print(error.format(data["name"], filename)) | print(error.format(data["name"], filename)) | ||||
continue | continue | ||||
@@ -126,7 +126,7 @@ class TokenizerTestCase(object): | |||||
def build(cls): | def build(cls): | ||||
"""Load and install all tests from the 'tokenizer' directory.""" | """Load and install all tests from the 'tokenizer' directory.""" | ||||
def load_file(filename, restrict=None): | def load_file(filename, restrict=None): | ||||
with codecs.open(filename, "rU", encoding="utf8") as fp: | |||||
with codecs.open(filename, "r", encoding="utf8") as fp: | |||||
text = fp.read() | text = fp.read() | ||||
name = path.split(filename)[1][:-len(extension)] | name = path.split(filename)[1][:-len(extension)] | ||||
cls._load_tests(filename, name, text, restrict) | cls._load_tests(filename, name, text, restrict) | ||||
@@ -1,17 +0,0 @@ | |||||
# -*- coding: utf-8 -*- | |||||
""" | |||||
It appears the default distutils test suite doesn't play nice with | |||||
``setUpClass`` thereby making some tests fail. Using ``unittest2`` to load | |||||
tests seems to work around that issue. | |||||
http://stackoverflow.com/a/17004409/753501 | |||||
""" | |||||
import os.path | |||||
import unittest | |||||
def additional_tests(): | |||||
project_root = os.path.split(os.path.dirname(__file__))[0] | |||||
return unittest.defaultTestLoader.discover(project_root) |