Make stand-alone usage of fake modules besides FakeOsModule possible
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by examining FakeOsModule and the Patcher to understand why standalone use currently works only for os. Then trace the patched shutil, pathlib, io, and possibly tempfile modules and their fixture, testcase, and decorator integrations; done means these modules can be used independently and work together without the Patcher.
Written by the indexing model from the issue text.
Description
There are use cases to use the patched modules separately from the Patcher and all derived methods.
This was actually the original usage at Google, before the Patcher and the related infrastructure had been added by @jmcgeheeiv, and came up recently for example in #1171.
Currently, only the os module can be reliably patched as a standalone module, both because some global patching is done in the Patcher code, and because other modules may depend on one another.
It shall be possible to use other patched modules seamlessly without the need for the Patcher (or the related fixture/testcase class/decorator). This is related to the patched shutil, pathlib, io and possibly tempfile modules.
- Dominant language
- Python
- Stars
- 756
- Forks
- 111
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytest-dev/pyfakefs
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pytest-dev/pyfakefs#1367 · 1 comment ·
Maintainers usually reply within 2 days
-
Real Path objects keep a lowercased _str_normcase after a fake filesystem session on Python 3.14Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
pytest-dev/pyfakefs#1359 · 1 comment ·
Maintainers usually reply within 2 days
-
fnmatch.filter and glob don't match uppercase names under Windows simulationPossibly taken @sricharanreddycheruku claimed this 26 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
pytest-dev/pyfakefs#1345 · 4 comments ·
Maintainers usually reply within 2 days
-
`Path` is replaced with `FakePathlibPathModule` instead of `FakePath` when imported directlyPossibly taken @sunxiuguo claimed this 18 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
pytest-dev/pyfakefs#1334 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
pytest-dev/pyfakefs#1321 · 4 comments ·
Maintainers usually reply within 2 days
All issues in pytest-dev/pyfakefs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/markitdown#2820 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
yt-project/yt#5624 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NousResearch/hermes-agent#148376 ·
Maintainers usually reply within 1 day