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

test_lazy fails if django is installed #335

Open
mgorny opened this issue Jul 11, 2020 · 1 comment
Open

test_lazy fails if django is installed #335

mgorny opened this issue Jul 11, 2020 · 1 comment

Comments

@mgorny
Copy link

mgorny commented Jul 11, 2020

I'm getting the following test failure if django is installed on the system:

=============================================================== test session starts ===============================================================
platform linux -- Python 3.9.0b4, pytest-4.6.11, py-1.8.0, pluggy-0.13.1
rootdir: /tmp/six, inifile: setup.cfg
plugins: pyfakefs-3.7.2, flaky-3.7.0, hypothesis-4.57.1
collected 200 items                                                                                                                               

test_six.py ........F.............................................sssssssssssssss.......................................................... [ 63%]
.........................................................................                                                                   [100%]

==================================================================== FAILURES =====================================================================
____________________________________________________________________ test_lazy ____________________________________________________________________

    def test_lazy():
        if six.PY3:
            html_name = "html.parser"
        else:
            html_name = "HTMLParser"
>       assert html_name not in sys.modules
E       AssertionError: assert 'html.parser' not in {'__future__': <module '__future__' from '/usr/lib/python3.9/__future__.py'>, '__main__': <module '__main__' from '/usr/lib/python-exec/python3.9/pytest'>, '_abc': <module '_abc' (built-in)>, '_ast': <module '_ast' (built-in)>, ...}
E        +  where {'__future__': <module '__future__' from '/usr/lib/python3.9/__future__.py'>, '__main__': <module '__main__' from '/usr/lib/python-exec/python3.9/pytest'>, '_abc': <module '_abc' (built-in)>, '_ast': <module '_ast' (built-in)>, ...} = sys.modules

test_six.py:94: AssertionError
================================================ 1 failed, 184 passed, 15 skipped in 0.66 seconds =================================================

Apparently, django is loaded somehow, and it causes html.parser module to be loaded. Maybe the initial assert could be replaced by skipping the test?

@mgorny
Copy link
Author

mgorny commented Jul 11, 2020

This is with fresh git (c0be881) and django-3.0.8.

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