code: def test_astype_extension_dtypes(self, any_int_ea_dtype):
      # GH#22578
      dtype = any_int_ea_dtype
      df = DataFrame(
          [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], columns=["a", "b"]
      )
  
      expected1 = DataFrame(
          {
              "a": pd.array([1, 3, 5], dtype=dtype),
              "b": pd.array([2, 4, 6], dtype=dtype),
          }
      )
      tm.assert_frame_equal(df.astype(dtype), expected1)
      tm.assert_frame_equal(df.astype("int64").astype(dtype), expected1)
      tm.assert_frame_equal(df.astype(dtype).astype("float64"), df)
  
      df = DataFrame(
          [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], columns=["a", "b"]
      )
      df["b"] = df["b"].astype(dtype)
      expected2 = DataFrame(
          {"a": [1.0, 3.0, 5.0], "b": pd.array([2, 4, 6], dtype=dtype)}
      )
      tm.assert_frame_equal(df, expected2)
  
      tm.assert_frame_equal(df.astype(dtype), expected1)
      tm.assert_frame_equal(df.astype("int64").astype(dtype), expected1)
  
imports: import re
  import numpy
  import pytest
  import pandas.util._test_decorators
  import pandas
  from pandas import Categorical, CategoricalDtype, DataFrame, DatetimeTZDtype, Index, Interval, IntervalDtype, NaT, Series, Timedelta, Timestamp, concat, date_range, option_context
  import pandas._testing
label_desc: Use image node_id 15 for calling the TestAstype obj's underlying member method code with example usage: obj.test_astype_extension_dtypes(any_int_ea_dtype) without return types