File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ def __post_init__(self):
3030 """Initialize EasyOCR reader with configuration settings and validation."""
3131 if not self .lang_list :
3232 raise ValueError ("lang_list must contain at least one language code." )
33- if self .cache_ttl < 0 :
34- raise ValueError ("cache_ttl must be non-negative ." )
33+ if self .cache_ttl <= 0 :
34+ raise ValueError ("cache_ttl must be positive ." )
3535
3636 self .reader = easyocr .Reader (
3737 lang_list = self .lang_list ,
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ def test_easyocr_config_validation(self):
9393 with pytest .raises (ValueError , match = "lang_list must contain at least one" ):
9494 EasyOCRConfig (lang_list = [])
9595 # raise error if cache_ttl is negative
96- with pytest .raises (ValueError , match = "cache_ttl must be non-negative " ):
97- EasyOCRConfig (cache_ttl = - 1 )
96+ with pytest .raises (ValueError , match = "cache_ttl must be positive " ):
97+ EasyOCRConfig (cache_ttl = 0 )
9898
9999
100100
You can’t perform that action at this time.
0 commit comments