Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

BeautifulSoup generating warnings during tests #52

@mgiuca

Description

@mgiuca
  1. ./run_tests.py py

Tests are generating this warning:

/usr/local/lib/python2.7/dist-packages/bs4/__init__.py:166: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

To get rid of this warning, change this:

 BeautifulSoup([your markup])

to this:

 BeautifulSoup([your markup], "lxml")

  markup_type=markup_type))

Most calls to BeautifulSoup pass 'html.parser' as the parser, but there are lots of calls to BeautifulSoup with no explicit parser, which is what this is warning about. We can go through and set all of them to 'html.parser'.

But the test in report_test.py, TestGenerateSummary.test_generate_summary fails if you use 'html.parser'. It passes if you use 'lxml', but this indicates a problem with the test if the choice of parser matters. And also it means we have an unspecified dependency on lxml. So this is a legitimate warning that we don't want to ignore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions