earwig / mwparserfromhell

A Python parser for MediaWiki wikicode
https://mwparserfromhell.readthedocs.io/
MIT License
741 stars 74 forks source link

Test failure on s390x and other architectures in Debian #277

Closed legoktm closed 3 years ago

legoktm commented 3 years ago

I just uploaded 0.6.2 to Debian and I'm seeing test failures on s390x, hppa, powerpc, ppc64, and sparc64 architectures. s390x is a release architecture, so the failure there prevents 0.6.2 from moving forward.

=================================== FAILURES ===================================
___________________________________ test_url ___________________________________

    def test_url():
        """test getter/setter for the url attribute"""
        url = wraptext("http://example.com/")
        node1 = ExternalLink(url, brackets=False)
        node2 = ExternalLink(url, wraptext("Example"))
        assert url is node1.url
        assert url is node2.url
        node1.url = "mailto:héhehé@spam.com"
        node2.url = "mailto:héhehé@spam.com"
>       assert_wikicode_equal(wraptext("mailto:héhehé@spam.com"), node1.url)

tests/test_external_link.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:138: in assert_wikicode_equal
    _assert_node_equal(expected.get(i), actual.get(i))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

expected = 'mailto:héhehé@spam.com', actual = 'mailto:héhehé@spam.com'

    def _assert_node_equal(expected, actual):
        """Assert that two Nodes have the same type and have the same data."""
        registry = {
            Argument: _assert_argument_node_equal,
            Comment: _assert_comment_node_equal,
            ExternalLink: _assert_external_link_node_equal,
            Heading: _assert_heading_node_equal,
            HTMLEntity: _assert_html_entity_node_equal,
            Tag: _assert_tag_node_equal,
            Template: _assert_template_node_equal,
            Text: _assert_text_node_equal,
            Wikilink: _assert_wikilink_node_equal,
        }
        # pylint: disable=unidiomatic-typecheck
>       assert type(expected) == type(actual)
E       AssertionError: assert <class 'mwparserfromhell.nodes.text.Text'> == <class 'mwparserfromhell.nodes.external_link.ExternalLink'>
E        +  where <class 'mwparserfromhell.nodes.text.Text'> = type('mailto:héhehé@spam.com')
E        +  and   <class 'mwparserfromhell.nodes.external_link.ExternalLink'> = type('mailto:héhehé@spam.com')

tests/conftest.py:43: AssertionError
=========================== short test summary info ============================
FAILED tests/test_external_link.py::test_url - AssertionError: assert <class ...
================== 1 failed, 1988 passed, 1 skipped in 1.54s ===================

https://buildd.debian.org/status/package.php?p=mwparserfromhell has the other logs, basically identical.

legoktm commented 3 years ago

I just uploaded 0.6.3 to Debian and it built and passed tests on s390x, thanks!