We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description pathlib.Path(".").absolute() uses an unmocked os module and I can't find a way to reload it.
pathlib.Path(".").absolute()
os
How To Reproduce
from pyfakefs.fake_filesystem_unittest import TestCase import os import pathlib class Test(TestCase): def setUp(self): self.setUpPyfakefs() os.chdir("/") def test_cwd(self): print("cwd: %s" % os.getcwd()) dot_abs = pathlib.Path(".").absolute() print("dot abs: %s" % dot_abs) print("exists dot abs: %s" % dot_abs.exists())
Prints the following when running test_cwd
cwd: / dot abs: /home/k/PycharmProjects/mytestproj/tests exists dot abs: False
While I expected:
cwd: / dot abs: / exists dot abs: True
As can be seen the file system is mocked, but os.getcwd() used by the absolute() function of Path isn't and returns the real cwd.
Enviroment
Linux-4.18.0-25-generic-x86_64-with-Ubuntu-18.10-cosmic Python 3.6.8 (default, Apr 9 2019, 04:59:38) pyfakefs 4.0.2
The text was updated successfully, but these errors were encountered:
Thanks - I will have a look.
Sorry, something went wrong.
292c07f
@tnek213 - Thanks for catching this - I'm amazed that this came up only now!
@mrbean-bremen Thank you! Both for the lib which seems awesome and the amazing response time!
No branches or pull requests
Description
pathlib.Path(".").absolute()
uses an unmockedos
module and I can't find a way to reload it.How To Reproduce
Prints the following when running test_cwd
While I expected:
As can be seen the file system is mocked, but os.getcwd() used by the absolute() function of Path isn't and returns the real cwd.
Enviroment
The text was updated successfully, but these errors were encountered: