hhursev / recipe-scrapers

Python package for scraping recipes data
MIT License
1.73k stars 527 forks source link

Tests: correctness: ensure that deprecation warnings are always emitted when checking for them #1343

Closed jayaddison closed 1 day ago

jayaddison commented 1 week ago

Without this fix applied, these tests could fail if Python warning filtering was configured in a way that interfered with the emission of the warnings - for example, when PYTHONWARNINGS="ignore" is configured as an environment variable.

By adding a simplefilter to always-emit DeprecationWarning notices, we can ensure that the test assertions apply correctly regardless of Python warning configuration.

jayaddison commented 1 day ago

Thanks @jknndy!