title: What is the type hint for Pytest's "caplog" fixture?
body: <p>As the title says. I am using the <code>caplog</code> fixture that comes with pytest. I am using mypy for my type checking, and would like to know what the correct type hint for caplog is.</p>
  <p>For example:</p>
  <pre class="lang-py prettyprint-override"><code>def test_validate_regs(caplog: Any) -&gt; None:
      validate_regs(df, logger)
      assert caplog.text == &quot;&quot;, &quot;No logs should have been made.&quot;
  </code></pre>
  <p>In this example, I have it set to <code>Any</code>, but I am wondering if there is a more specific type hint I can use.</p>
  <p>I've tried reading the docs on caplog, as well as searching the pytest code in github to see what the caplog fixture returns, but couldn't find anything more than <a href="https://github.com/pytest-dev/pytest/blob/878a51ef531b6de49fb7ab7a2fa4cd0034a64172/src/_pytest/reports.py#L115" rel="noreferrer">the following</a>. But using a <code>str</code> type just gave me an error, saying that <code>str</code> type doesn't have the attribute <code>text</code>, which makes sense.</p>
  <p>When I print the type of caplog I get <code>_pytest.logging.LogCaptureFixture</code> although I'm not sure how I'd import this from <code>_pytest</code> and make use of it.</p>