{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/10"},{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/7"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/14"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"Provides a drop-in replacement for mock.mock_open that supports multiple files, persistent file state across open calls, and standard file operations like read, write, seek, and tell.","skillfed_tags":["abandoned","testing-utility"],"use_cases":["Test code that reads configuration files without creating temporary files on disk","Verify file write operations in unit tests by checking mock call arguments and state","Mock multiple file paths in a single test to simulate complex I/O scenarios","Test error handling for file operations by setting IOError side effects on specific paths","Ensure file operations occur in the correct order or with expected arguments"],"what_it_does":"mock-open is a test utility that replaces the builtin open function with a mock that tracks file operations for unit testing. Unlike the standard mock.mock_open, it supports multiple file paths simultaneously, maintains file contents across separate open calls, and implements the full file API (read, write, seek, tell, readline, readlines, writelines). It's designed to let you test code that reads or writes files without touching the filesystem.\n\nThe package works by providing a MockOpen class that acts as a context manager and can be patched over builtins.open. You configure mock files by path, set their read_data or side effects, and then your code under test interacts with them as if they were real files. State persists between calls, so a write followed by a read on the same path returns what was written.","worth_installing":"No. The package is abandoned (last release 2020-04-15, last commit 2020-10-10) with no maintenance or security updates. The standard library's mock.mock_open has likely evolved to address the gaps that motivated mock-open, and relying on unmaintained test infrastructure creates long-term risk. Use unittest.mock.mock_open or consider pytest-mock and related modern alternatives instead."},"id":"mock-open","links":{"html":"https://skillfed.io/packages/mock-open","md":"https://skillfed.io/packages/mock-open.md","pypi":"https://pypi.org/project/mock-open/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2020-04-15","license_spdx":null,"license_treatment":"permissive","name":"mock-open","python_support":"unspecified","summary":"A better mock for file I/O"},"popularity":{"monthly_downloads":257624,"position":8439,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.4.0"}
