Closed mrwbarg closed 1 year ago
Base: 74.85% // Head: 74.89% // Increases project coverage by +0.03%
:tada:
Coverage data is based on head (
5432ad6
) compared to base (8846c75
). Patch coverage: 100.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Fixes #374.
When reading threshold values from the settings, the
BaseStatMonitor
used thesettings.get()
function. This works fine if the value is set in the project's settings as the data type is preserved when reading it. However, when getting the settings from a Scrapy Cloud project, using the bareget()
function causes the value to be read as a string, which break comparisions.The monitor was updated to use by default the
getfloat
function. A variable was added which allows setting the threshold data type (eitherint
orfloat
) along with a property that picks the correct get function depending on the data type.Two new unit tests were added to test for the cases where the values are actual strings.
Despite there being other monitors that inherit from BaseStatMonitor, no further changes were necessary as they'll benefit from the default
getfloat()
function.