code: def test_token_type_invalid(self, warning):
      tokens = (
          "{1, 2",
          "}",
          "'abc",
          "def'",
          '"ghi',
          'jkl"',
      )
      errors = (
          r".+: invalid value set \(missing closing brace\):",
          r".+: invalid value set \(missing opening brace\):",
          r".+: malformed string literal \(missing closing quote\):",
          r".+: malformed string literal \(missing opening quote\):",
          r".+: malformed string literal \(missing closing quote\):",
          r".+: malformed string literal \(missing opening quote\):",
      )
      for token, error in zip(tokens, errors):
          try:
              _token_type(token)
          finally:
              raw_warnings = warning.getvalue()
              warnings = [
                  w for w in raw_warnings.split("\n") if w.strip()
              ]
  
              assert len(warnings) == 1
              assert re.compile(error).match(warnings[0])
              warning.truncate(0)
  
imports: import re
  from collections import namedtuple
  from inspect import cleandoc
  from textwrap import dedent
  from unittest import mock
  import pytest
  from sphinx.ext.napoleon import Config
  from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring, _convert_numpy_type_spec, _recombine_set_tokens, _token_type, _tokenize_type_spec
  from tests.test_extensions.ext_napoleon_pep526_data_google import PEP526GoogleClass
  from tests.test_extensions.ext_napoleon_pep526_data_numpy import PEP526NumpyClass
label_desc: Use image node_id 23 for calling the TestNumpyDocstring obj's underlying member method code with example usage: obj.test_token_type_invalid(warning) without return types