@@ -253,15 +253,46 @@ def test_validate_valid_data_no_issues(self):
253253class TestValidateEquity :
254254 """Tests for equity-specific validation."""
255255
256- def test_validate_weekend_data (self ):
256+ @pytest .mark .parametrize (
257+ "timestamp" ,
258+ [
259+ pytest .param (datetime (2025 , 7 , 7 , 10 ), id = "monday" ),
260+ pytest .param (datetime (2025 , 7 , 8 , 10 ), id = "tuesday" ),
261+ pytest .param (datetime (2025 , 7 , 9 , 10 ), id = "wednesday" ),
262+ pytest .param (datetime (2025 , 7 , 10 , 10 ), id = "thursday" ),
263+ pytest .param (datetime (2025 , 7 , 11 , 10 ), id = "friday" ),
264+ ],
265+ )
266+ def test_validate_regular_weekdays_do_not_report_weekend (self , timestamp ):
267+ info = AssetInfo (symbol = "SPY" , asset_class = AssetClass .EQUITY , exchange = "NYSE" )
268+ df = pl .DataFrame (
269+ {
270+ "timestamp" : [timestamp ],
271+ "open" : [100.0 ],
272+ "high" : [101.0 ],
273+ "low" : [99.0 ],
274+ "close" : [100.0 ],
275+ "volume" : [1000.0 ],
276+ }
277+ )
278+
279+ assert AssetValidator (info ).validate (df ) == {}
280+
281+ @pytest .mark .parametrize (
282+ "timestamp" ,
283+ [
284+ pytest .param (datetime (2025 , 7 , 12 , 10 ), id = "saturday" ),
285+ pytest .param (datetime (2025 , 7 , 13 , 10 ), id = "sunday" ),
286+ ],
287+ )
288+ def test_validate_weekend_data (self , timestamp ):
257289 """Test detecting weekend data for equities."""
258290 info = AssetInfo (symbol = "AAPL" , asset_class = AssetClass .EQUITY )
259291 validator = AssetValidator (info )
260292
261- # January 7, 2023 is a Saturday
262293 df = pl .DataFrame (
263294 {
264- "timestamp" : [datetime ( 2023 , 1 , 7 ) ],
295+ "timestamp" : [timestamp ],
265296 "open" : [100.0 ],
266297 "high" : [101.0 ],
267298 "low" : [99.0 ],
@@ -272,8 +303,7 @@ def test_validate_weekend_data(self):
272303
273304 results = validator .validate (df )
274305
275- assert "equity_specific" in results
276- assert any ("weekend" in issue .lower () for issue in results ["equity_specific" ])
306+ assert results == {"equity_specific" : ["Found 1 weekend data points" ]}
277307
278308 def test_validate_negative_prices (self ):
279309 """Test detecting non-positive prices."""
0 commit comments