code: def test_record(self) -> None:
      with pytest.warns(UserWarning) as record:
          warnings.warn("user", UserWarning)
  
      assert len(record) == 1
      assert str(record[0].message) == "user"
  
imports: import warnings
  from typing import List
  from typing import Optional
  from typing import Type
  import pytest
  from _pytest.pytester import Pytester
  from _pytest.recwarn import WarningsRecorder
label_desc: Use image node_id 6 for calling the TestWarns obj's underlying member method code with example usage: obj.test_record() without return types