diff --git a/src/mdformat/_cli.py b/src/mdformat/_cli.py index 5d049c6..11899b7 100644 --- a/src/mdformat/_cli.py +++ b/src/mdformat/_cli.py @@ -3,7 +3,6 @@ import argparse from collections.abc import Generator, Iterable, Mapping, Sequence import contextlib -import inspect import logging import os.path from pathlib import Path @@ -426,12 +425,6 @@ def log_handler_applied( logger.removeHandler(handler) -def get_package_name(obj: object) -> str | None: - """Return top level module name, or None if not found.""" - module = inspect.getmodule(obj) - return module.__name__.split(".", maxsplit=1)[0] if module else None - - def get_plugin_info_str( parser_extension_dists: Mapping[str, tuple[str, list[str]]], codeformatter_dists: Mapping[str, tuple[str, list[str]]], diff --git a/tests/test_cli.py b/tests/test_cli.py index 97461c4..22f488e 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -6,7 +6,7 @@ import pytest import mdformat -from mdformat._cli import get_package_name, get_plugin_info_str, run, wrap_paragraphs +from mdformat._cli import get_plugin_info_str, run, wrap_paragraphs from mdformat.plugins import CODEFORMATTERS, PARSER_EXTENSIONS from tests.utils import ( FORMATTED_MARKDOWN, @@ -345,13 +345,6 @@ def test_eol__check_keep_crlf(tmp_path): assert run((str(file_path), "--check", "--end-of-line=keep")) == 1 -def test_get_package_name(): - # Test a function/class - assert get_package_name(patch) == "unittest" - # Test a package/module - assert get_package_name(mdformat) == "mdformat" - - def test_get_plugin_info_str(): info = get_plugin_info_str( {"mdformat-tables": ("0.1.0", ["tables"])},