Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-create the temp directory on resetting the filesystem #818

Merged
merged 2 commits into from
Apr 23, 2023

Conversation

mrbean-bremen
Copy link
Member

@mrbean-bremen mrbean-bremen commented Apr 22, 2023

This slightly changes the behavior if you are creating a fake filesystem without using any of the recommended methods (e.g. the temp directory is now also created in this case), but I think that this is ok.

Tasks

  • Unit tests added that reproduce the issue or prove feature is working
  • Fix or feature added
  • Entry to release notes added
  • Pre-commit CI shows no errors
  • Unit tests passing

@davidlbaird
Copy link
Collaborator

A large number of test modules are not using the patcher to instantiate fake_filesystem and may be mocking or making use of tempdir independently of pyfakefs. Please be careful with this change.

- the temp dir is now created during filesystem
  initialization instead of at patcher setup if configured
- this is only done by default if created from the Patcher
- fixes pytest-dev#814
pyfakefs/fake_filesystem.py Outdated Show resolved Hide resolved
pyfakefs/fake_filesystem.py Show resolved Hide resolved
pyfakefs/fake_filesystem.py Outdated Show resolved Hide resolved
pyfakefs/fake_filesystem.py Show resolved Hide resolved
Copy link
Collaborator

@davidlbaird davidlbaird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I'll need to figure out how to get notified of pull request review updates.

- change from review
Copy link
Collaborator

@davidlbaird davidlbaird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INTERNALERROR /path/to/file is not in the subpath of '\\/path/to/file'
2 participants