Farhood Etaati

07/25/2023, 3:09 PM
How do I change the log level to debug in my tests? I'm trying to use a fixture like this:
Copy code
@pytest.fixture(autouse=True, scope="session")
def _prefect_debug_log_level() -> Generator[None, Any, None]:
    with temporary_settings(updates={PREFECT_LOGGING_LEVEL: "DEBUG"}):
But my test does not show the debug logs:
Copy code
def my_flow():
   get_run_logger().debug("Hi this is a sample flow!")

async def test_flow(
    _prefect_debug_log_level: None,
) -> None:
   with prefect_test_harness(): 
       my_flow() # Does not show the debug log in the flow