$npx skillfedfor your agent

flake8-mock-spec

A linter that checks mocks are constructed with the spec argument

With conditionsPyPI Python ModulesReleased Jan 2023127.5K downloads / moApache 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — flake8_mock_spec-1.4.0-py3-none-any.whl
v1.4.0 · released 2023-01-14 · Python >=3.8.1,<4.0.0 · 1 runtime deps: flake8

Yes, if you are already using flake8 and want to catch mock misuse in your test suite. The plugin is lightweight, has no complex dependencies, and solves a real problem. However, be aware that it is abandoned and will not receive updates or bug fixes—if you encounter issues with newer versions of flake8 or Python, you will need to maintain or fork it yourself.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction installation as a pure Python wheel with only flake8 as a runtime dependency.
  • However, the package is abandoned—last release was 2023-01-14 with no updates since, so expect no maintenance or bug fixes going forward.

License · maintenance · safety

Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions. No licensing friction for most projects.

last release 2023-01-14 (1308 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 127,524 downloads/mo, #11,739 on PyPI

Verify before relying

pip install flake8-mock-spec

# Then run flake8 on your test files:
flake8 test_source.py

# The plugin will warn on mocks without spec:
# test_source.py:5:22: TMS010 unittest.mock.Mock instances should be constructed with the spec or spec_set argument
  • Compatibility with flake8 versions released after 2023-01-14 is unverified given the package's abandoned status.
  • Whether the plugin works correctly with modern unittest.mock patterns or async testing frameworks beyond what the description covers.
Same gist for agents: .md · .json

What it is and what it does

flake8-mock-spec is a linter plugin for flake8 that detects when unittest.mock objects (Mock, MagicMock, NonCallableMock, AsyncMock) are created without a spec or spec_set argument, and when patch operations lack spec-related arguments. It enforces a best practice: mocks should declare what interface they conform to, preventing tests from passing when they access methods or attributes that don't exist on the real object being mocked.

The plugin defines seven linting rules (TMS010–TMS013 for mock construction, TMS020–TMS022 for patch operations) that can be selectively suppressed. It integrates directly into your flake8 workflow with no additional configuration required beyond installation. However, the package has been abandoned since its single release in January 2023, meaning no updates or maintenance will occur.

Use it for

  • Catch bugs in unit tests where mocks are called with methods that don't exist on the real object, preventing false test passes.
  • Enforce team standards that all mocks must declare their spec to keep test code aligned with actual interfaces.
  • Validate patch operations in test suites to ensure they include spec or autospec arguments for safer mocking.
  • Integrate mock validation into CI/CD pipelines via flake8 to fail builds when mocks are created without spec constraints.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are already using flake8 and want to catch mock misuse in your test suite.

The plugin is lightweight, has no complex dependencies, and solves a real problem. However, be aware that it is abandoned and will not receive updates or bug fixes—if you encounter issues with newer versions of flake8 or Python, you will need to maintain or fork it yourself.

Install

flake8-mock-spec on PyPI

Before you install

Low friction installation as a pure Python wheel with only flake8 as a runtime dependency. However, the package is abandoned—last release was 2023-01-14 with no updates since, so expect no maintenance or bug fixes going forward.

License in practice

Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions. No licensing friction for most projects.

Quickstart

pip install flake8-mock-spec

# Then run flake8 on your test files:
flake8 test_source.py

# The plugin will warn on mocks without spec:
# test_source.py:5:22: TMS010 unittest.mock.Mock instances should be constructed with the spec or spec_set argument

Verify before relying

  • Compatibility with flake8 versions released after 2023-01-14 is unverified given the package's abandoned status.
  • Whether the plugin works correctly with modern unittest.mock patterns or async testing frameworks beyond what the description covers.

Package facts

LicenseApache 2.0 permissive
Python supportSupports the current Python release >=3.8.1,<4.0.0
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
flake8
MaintenanceAbandoned 1,308 days since the last release
First released
Downloads127,524 / month, #11,739 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Environment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseLicense :: Other/Proprietary LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Evidence: flake8_mock_spec-1.4.0-py3-none-any.whl

Tags

Capabilities
flake8 mock linterunittest mock spec checkermock specification enforcementflake8 testing pluginmock object validationprevent mock misusespec argument linter
Topics
testingmock-validationflake8-plugin

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “flake8 mock linter”

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also hacking · flake8 · mock · dlint · flexmock · flake8-annotations · flake8-formatter-junit-xml · callee · flake8-bandit · flake8-tidy-imports