Closed Vekhir closed 1 year ago
So apparently, the issue is that starting with BeautifulSoup 4.12.1, Tag.prettify adds some newlines at the end. From the changelog:
* Tag.prettify() will now consistently end prettified markup with
a newline.
prettify is used in the DFXPWriter.write method, so the output changes, and the tests make a strict comparison where the added newline leads to failure.
Either the tests somehow ignore the newline/check both cases, or the test fixture adds the newline and the requirements go up to 4.12.1.\ A PR for the latter case may follow shortly.
The relevant PR is https://github.com/pbs/pycaption/pull/305
Hi, \ I recently upgraded bs4 from 4.11.2 to 4.12.2 and now pycaption fails during testing. \ I'm not exactly sure where the issue is, so I'm starting here and maybe you can reproduce it or give some insight into the kind of error.
Can you verify the issue?
Additional information
Going through the bs4 changelog, I didn't notice any change related to this issue.\ I have also rebuilt pycaption with bs4 4.11.2 and the tests ran through just fine. My distro doesn't package 4.12.0 or 4.12.1, but if necessary, I might do some bisecting.Edit: The issue is changed behaviour in BeautifulSoup 4.12.1 with regards to Tags.prettify, which adds newlines to some outputs. The tests don't account for these newlines, which is why they fail. The most straight-forward solution is to adapt the tests and bump the requirements (See also #305). More details below.
System information
OS: Arch Linux Kernel: 6.3.2-arch1-1 Python: 3.11.3-1 Pycaption: 2.1.0/2.1.1 (AUR package / manually updated to 2.1.1) BeautifulSoup4: 4.11.2-3/4.12.2-1 (Official package)
Appendix 1 (full error log)