Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed tests on CPython 3.5.0 #83

Closed
zmwangx opened this issue Sep 21, 2015 · 0 comments
Closed

Failed tests on CPython 3.5.0 #83

zmwangx opened this issue Sep 21, 2015 · 0 comments

Comments

@zmwangx
Copy link
Contributor

zmwangx commented Sep 21, 2015

Some of the tests are not compatible with CPython 3.5.0. With latest release 0.22.0 (and probably also master, since there's only one, unrelated commit since the latest release), four out of the six make test tests fail:

      2 - html_normalization (Failed)
      3 - spectest_library (Failed)
      5 - spectest_executable (Failed)
      6 - smartpuncttest_executable (Failed)

A sample test log is here: https://gist.github.com/a13cfb20c900e16a8bf0.

Most of the failures are due to the removed HTMLParseError in Python 3.5, and that one is easy to fix. See my proposed changes in #84 . After applying my patch, tests 3, 5, and 6 all pass, but there's still a non-trivial failure in html_normalization's doctest (log is here: https://gist.github.com/12b71e2ef22ef4b9d635):

Command: "/usr/local/bin/python3" "-m" "doctest" "/tmp/commonmark20150920-37576-vpuo15/cmark-0.22.0/test/normalize.py"
Directory: /tmp/commonmark20150920-37576-vpuo15/cmark-0.22.0/build/testdir
"html_normalization" start time: Sep 20 16:36 PDT
Output:
----------------------------------------------------------
**********************************************************************
File "/tmp/commonmark20150920-37576-vpuo15/cmark-0.22.0/test/normalize.py", line 170, in normalize.normalize_html
Failed example:
    normalize_html("∀&><"")
Expected:
    '\u2200&><"'
Got:
    '∀&><"'
**********************************************************************
1 items had failures:
   1 of  10 in normalize.normalize_html
***Test Failed*** 1 failures.

Looks like somehow the HTML entities have been decoded. I think it is related to the Python 3.5 change to HTMLParser: the convert_charrefs argument to __init__, introduced in Python 3.4, is now default to True. But I've tried passing convert_charrefs=False to __init__; that doesn't immediately fix the problem. I haven't got time to read through normalize.py, so perhaps someone else has to look at what's wrong with it.


P.S. Quoting from https://docs.python.org/3.5/whatsnew/3.5.html:

The deprecated “strict” mode and argument of HTMLParser, HTMLParser.error(), and the HTMLParserError exception have been removed. (Contributed by Ezio Melotti in issue 15114.) The convert_charrefs argument of HTMLParser is now True by default. (Contributed by Berker Peksag in issue 21047.)

tdsmith pushed a commit to Homebrew/legacy-homebrew that referenced this issue Sep 22, 2015
`make test` fails due to incompatibility with CPython 3.5.

commonmark/cmark#83
#44197

Closes #44246.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
@jgm jgm closed this as completed in cc9c767 Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant