diff --git a/anyloadump/loadump.py b/anyloadump/loadump.py
index 18050d2..a5944bf 100644
--- a/anyloadump/loadump.py
+++ b/anyloadump/loadump.py
@@ -1,7 +1,7 @@
 from enum import Enum
 
 import subprocess, os, re, codecs
-import logging
+import logging, importlib
 
 logger = logging.getLogger(__name__)
 
@@ -49,7 +49,8 @@ may raise ExtensionInferenceError
 def _invoke(dump_mode: DumpMode, file=None, fmt=None):
     ext = _extract_extension(file) if file else fmt
     if ext is None: raise ExtensionNotInferredError
-    target = _extract_extension(file).__import__(ext)
+    target = importlib.import_module(ext)
+    logger.debug("module : {}".format(target))
     # "[load|dump]s?"
     method_mappings = dict(zip(list("rawx"), ["load"] + ["dump"] * 3))
     return getattr(target, method_mappings[dump_mode.value] + 's' * (not file))

use importlib.import_module instead of __import__
https://docs.python.org/3.6/library/functions.html#__import__ says

> This is an advanced function that is not needed in everyday Python programming, unlike importlib.import_module().


diff --git a/tests/test_loadump.py b/tests/test_loadump.py
index d2f37fe..14b5921 100644
--- a/tests/test_loadump.py
+++ b/tests/test_loadump.py
@@ -1,4 +1,5 @@
 from anyloadump import loadump
+from anyloadump.loadump import DumpMode
 import unittest
 import os
 import logging
@@ -34,3 +35,81 @@ class LoadumpTests(unittest.TestCase):
         res = loadump._extract_extension(self._get_path("data/sample.pickle"))
         self.assertEqual(res, "pickle")
         self.assertEqual(loadump._extract_extension(self._get_path("data/dummy")), "")
+
+    def test_invoke(self):
+
+        import logging
+        logging.basicConfig(level=logging.ERROR)
+        logging.getLogger("anyloadump.loadump").setLevel(logging.DEBUG)
+        import pickle
+
+        lst = [1,2,3]
+
+        # check if func is json.dump function
+        func = loadump._invoke(
+            dump_mode=DumpMode.WRITE,
+            file = self._get_path("data/sample.json")
+        )
+        self.assertTrue(hasattr(func, '__call__'))
+        self.assertEqual(func.__module__, "json")
+        self.assertEqual(func.__name__, "dump")
+
+        with open(self._get_path("data/out1.json"), "w") as fo:
+            res = func(lst, fo)
+        self.assertIsNone(res)
+
+        # check if func is json.load function
+        func = loadump._invoke(
+            dump_mode=DumpMode.READ,
+            file = self._get_path("data/sample.json")
+        )
+        self.assertTrue(hasattr(func, '__call__'))
+        self.assertEqual(func.__module__, "json")
+        self.assertEqual(func.__name__, "load")
+
+        with open(self._get_path("data/out1.json"), "r") as fi:
+            obj = func(fi)
+        self.assertEqual(lst, obj)
+
+        # check if func is pickle.load function
+        pickle_file = "data/sample.pickle"
+        func = loadump._invoke(
+            dump_mode=DumpMode.READ,
+            file = self._get_path(pickle_file)
+        )
+        self.assertTrue(hasattr(func, '__call__'))
+        self.assertEqual(func.__module__, "_pickle")
+        self.assertEqual(func.__name__, "load")
+
+        with open(self._get_path(pickle_file), "rb") as fi:
+            obj = func(fi)
+        with open(self._get_path(pickle_file), "rb") as fi:
+            obj_cmp = pickle.load(fi)
+        self.assertEqual(obj_cmp, obj)
+
+        # check if func is pickle.dumps function
+        func = loadump._invoke(
+            dump_mode=DumpMode.WRITE,
+            fmt = "pickle"
+        )
+        self.assertTrue(hasattr(func, '__call__'))
+        self.assertEqual(func.__module__, "_pickle")
+        self.assertEqual(func.__name__, "dumps")
+
+        self.assertEqual(func(lst), pickle.dumps(lst))
+
+        # check if res is pickle.loads function
+        func = loadump._invoke(
+            dump_mode=DumpMode.READ,
+            fmt = "pickle"
+        )
+        self.assertTrue(hasattr(func, '__call__'))
+        self.assertEqual(func.__module__, "_pickle")
+        self.assertEqual(func.__name__, "loads")
+
+
+        # check whether ExtensionNotInferredError raises if both file and fmt is None.
+        with self.assertRaises(loadump.ExtensionNotInferredError):
+            loadump._invoke(
+                dump_mode=DumpMode.READ,
+            )

pip install -e .
parse_log_pytest
pytest
pytest pytest-cov
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/knknkn1162/anyloadump.git@9f69fe9b1c27ec66d52e1eaa1028f89733aed842#egg=anyloadump
coverage==7.8.0
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
pytest-cov==6.0.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work

name: anyloadump
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - pytest-cov==6.0.0
prefix: /opt/conda/envs/anyloadump

tests/test_loadump.py::LoadumpTests::test_invoke
tests/test_loadump.py::LoadumpTests::test_is_binary
tests/test_loadump.py::LoadumpTests::test_extract_extension
anyloadump/loadump.py
anyloadump/loadump.py