diff options
author | mrbean-bremen <hansemrbean@googlemail.com> | 2023-04-12 20:44:19 +0200 |
---|---|---|
committer | mrbean-bremen <mrbean-bremen@users.noreply.github.com> | 2023-04-13 19:36:03 +0200 |
commit | 8ae128b384b2287843959ba208602c271bb1109a (patch) | |
tree | 031e8cb064bfccaf6e4280186ba127f83ef2d882 /pyfakefs | |
parent | ff6017333ad56295b766736ffb36647bf974dc13 (diff) | |
download | pyfakefs-8ae128b384b2287843959ba208602c271bb1109a.tar.gz |
Make sure a /tmp path exists under linux
- TMPDIR may point elsewhere
- fixes #810
Diffstat (limited to 'pyfakefs')
-rw-r--r-- | pyfakefs/fake_filesystem_unittest.py | 4 | ||||
-rw-r--r-- | pyfakefs/tests/fake_filesystem_unittest_test.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pyfakefs/fake_filesystem_unittest.py b/pyfakefs/fake_filesystem_unittest.py index 8036ab2..00831b6 100644 --- a/pyfakefs/fake_filesystem_unittest.py +++ b/pyfakefs/fake_filesystem_unittest.py @@ -895,8 +895,8 @@ class Patcher: # so we create it here for convenience assert self.fs is not None self.fs.create_dir(temp_dir) - if sys.platform == "darwin" and not self.fs.exists("/tmp"): - # under macOS, we also create a link in /tmp for convenience + if sys.platform != "win32" and not self.fs.exists("/tmp"): + # under Posix, we also create a link in /tmp if the path does not exist self.fs.create_symlink("/tmp", temp_dir) # reset the used size to 0 to avoid having the link size counted # which would make disk size tests more complicated diff --git a/pyfakefs/tests/fake_filesystem_unittest_test.py b/pyfakefs/tests/fake_filesystem_unittest_test.py index 5234238..f77677c 100644 --- a/pyfakefs/tests/fake_filesystem_unittest_test.py +++ b/pyfakefs/tests/fake_filesystem_unittest_test.py @@ -662,7 +662,7 @@ class TestTempDirCreation(fake_filesystem_unittest.TestCase): @unittest.skipIf(sys.platform == "win32", "POSIX only test") def testTmpExists(self): - # directory under Linux, link under macOS + # directory or link under Linux, link under macOS self.assertTrue(os.path.exists("/tmp")) |