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

os.path.sep is not changed after switching fs.os to linux #572

Closed
hard7 opened this issue Nov 30, 2020 · 1 comment
Closed

os.path.sep is not changed after switching fs.os to linux #572

hard7 opened this issue Nov 30, 2020 · 1 comment
Labels

Comments

@hard7
Copy link

hard7 commented Nov 30, 2020

Describe the bug
I'm running tests under windows using fs.os = OSType.LINUX. I noticed that os.path.sep is not faked.

How To Reproduce

import os
import pyfakefs
from pyfakefs.fake_filesystem import OSType


def test_sep_linux(fs):
    fs.os = OSType.LINUX
    assert os.path.sep == "/"
    # FAILED
    # Expected :/
    # Actual   :\\

Enviroment

>python -c "import platform; print(platform.platform())"
Windows-10-10.0.18362-SP0

>python -c "import sys; print('Python', sys.version)"
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]

>python -c "from pyfakefs.fake_filesystem import __version__; print('pyfakefs', __version__)"
pyfakefs 4.3.2
@mrbean-bremen
Copy link
Member

Thanks - good catch! The same is true for os.sep, os.altsep, and os.path.altsep. Changing the OS type does not reset them.

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

No branches or pull requests

2 participants