highlyavailable opened a new pull request, #50990:
URL: https://github.com/apache/airflow/pull/50990
**Fixes #50977**
## Problem
Two `TestFileTaskLogHandler` tests were marked with `@pytest.mark.xfail`
because they were written for the old logging format but needed to work with
the new structlog-based logging system:
- `test_file_task_handler_when_ti_value_is_invalid`
- `test_file_task_handler`
These tests were failing because they expected log data as strings but were
receiving `StructuredLogMessage` objects from the new structlog implementation.
## Solution
1. **Removed `@pytest.mark.xfail` decorators** - (tests now pass instead of
being marked as expected failures)
2. **Updated `test_file_task_handler` assertion logic**:
- **Before**: `assert re.search(target_re, log_content)` (regex matching
on string content)
- **After**: `assert any("test" in event for event in events(logs))`
(substring matching on event messages)
3. **No changes needed for
`test_file_task_handler_when_ti_value_is_invalid`** - This test actually
already used direct object access (`logs[0].event`) which works correctly with
`StructuredLogMessage` objects
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]