Beautiful Soup & Pytest conflict #12808
Labels
stale
status: needs information
reporter needs to provide more information; can be closed after 2 or more weeks of inactivity
Overview of issue
I am having an issue with BeautifulSoup and pytest. When I run pytest I get the following error:
TypeError: object.new() takes exactly one argument (the type to instantiate)
at this line of code in the function being tested:
soup = BeautifulSoup(response.text, 'html.parser')
I have no idea why this is happening but it means that I can't perform testing where BeautifulSoup is present. If I mock it I still run into the error, the only way to suppress it is to mock the new function, but this then leads to a whole host of other issues.
Here is the test code that fails:
Pip List output
Pytest version & OS Version
Pytest 8.1.1
mac sonoma 14.6.1
The text was updated successfully, but these errors were encountered: