pytest-dev / pytest-dev/pyfakefs

Optionally poison modules known to not work with pyfakefs

Open
#1,089 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
750
Forks
99
Avg merge
19h 6m
Merged PRs (30d)
6

Description

Is your feature request related to a problem? Please describe.
https://github.com/pytest-dev/pyfakefs/blob/main/docs/troubleshooting.rst#modules-not-working-with-pyfakefs documents a number of modules, most obviously multiprocessing and subprocess, as not playing nice with pyfakefs.

Describe the solution you'd like
I'd like to have a way for tests that call into functions in these modules to raise an exception (or at least raise a warning).

Describe alternatives you've considered
Trying to track down failures based on when pyfakefs does fail (often long after the call into problematic code in those modules).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the “Modules not working with pyfakefs” section in docs/troubleshooting.rst and reproduce the delayed failures involving multiprocessing and subprocess. Then trace how pyfakefs intercepts filesystem-related calls to determine where detection could occur. Done means documented problematic modules trigger a clear exception or warning during tests, with coverage for the selected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.