class_docstr: Test common dtype coercion rules between concat and append.
class_docstr_tok: ["Test","common","dtype","coercion","rules","between","concat","and","append","."]
code: def test_dtypes(self, item, index_or_series, using_infer_string):
      # to confirm test case covers intended dtypes
      typ, vals = item
      obj = index_or_series(vals)
      if typ == "object" and using_infer_string:
          typ = "string"
      if isinstance(obj, Index):
          assert obj.dtype == typ
      elif isinstance(obj, Series):
          if typ.startswith("period"):
              assert obj.dtype == "Period[M]"
          else:
              assert obj.dtype == typ
  
imports: import numpy
  import pytest
  import pandas
  from pandas import Categorical, DataFrame, Index, Series
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestConcatAppendCommon obj's underlying member method code with example usage: obj.test_dtypes(item, index_or_series, using_infer_string) without return types