Skip to content

Importing bs4 in tests #3605

Closed
Closed
@jseabold

Description

@jseabold

I just got a bunch of test errors because I don't have bs4. I do have lxml. Haven't looked at this at all to see why the test isn't conditional. E.g.,

======================================================================
ERROR: test_string (pandas.io.tests.test_html.TestBs4ReadHtml)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/skipper/src/pandas-skipper/pandas/io/tests/test_html.py", line 221, in test_string
    df1 = self.run_read_html(data, '.*Water.*', infer_types=False)
  File "/home/skipper/src/pandas-skipper/pandas/io/tests/test_html.py", line 324, in run_read_html
    return _run_read_html(*args, **kwargs)
  File "/home/skipper/src/pandas-skipper/pandas/io/tests/test_html.py", line 31, in _run_read_html
    return read_html(*args, **kwargs)
  File "/home/skipper/src/pandas-skipper/pandas/io/html.py", line 701, in read_html
    for data in p.parse_raw_data()]
  File "/home/skipper/src/pandas-skipper/pandas/io/html.py", line 152, in parse_raw_data
    for rows in self.parse_rows()]
  File "/home/skipper/src/pandas-skipper/pandas/io/html.py", line 137, in parse_rows
    tables = self._parse_tables(self._build_doc(), self.match, self.attrs)
  File "/home/skipper/src/pandas-skipper/pandas/io/html.py", line 333, in _build_doc
    from bs4 import BeautifulSoup, SoupStrainer
ImportError: No module named bs4

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions