You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i'm having a hard time understanding the role a trailing '/' character plays in pyfakefs' add_real_directory() call.
I saw this problem when trying to setup my timezone via pytz. Pytz seems to load the timezone information from a file with in it's installation directory. I've written two tests and ran them like so:
test_pytz_fakefs_no_exception.py seems to fail while test_pytz_fakefs_no_exception.py seems to succeed and I just don't understand why the API would be so stringent. Anyway, thought I'd file it here if it were considered to be a bug.
I've attached the test cases to this ticket, thank you for taking a look. tests.zip
Pytest/pyfakefs version: $> pytest --version This is pytest version 3.9.3, imported from /usr/local/lib/python3.6/dist-packages/pytest.py setuptools registered plugins: pytest-mock-1.10.0 at /usr/local/lib/python3.6/dist-packages/pytest_mock.py pyfakefs-3.5 at /usr/local/lib/python3.6/dist-packages/pyfakefs/pytest_plugin.py
Python version: $> python3 --version Python 3.6.6
The text was updated successfully, but these errors were encountered:
Thanks for the report!
The behavior is probably related to mkdir or makedirs, where a trailing slash is not allowed on some systems, IIRC. I agree that it is a needless restriction for our own functions, and can be removed. I will have a closer look in the evening, should be an easy fix.
Hi, i'm having a hard time understanding the role a trailing '/' character plays in pyfakefs' add_real_directory() call.
I saw this problem when trying to setup my timezone via pytz. Pytz seems to load the timezone information from a file with in it's installation directory. I've written two tests and ran them like so:
pytest -s test_pytz_fakefs_no_exception.py pytest -s test_pytz_fakefs_with_exception.py
test_pytz_fakefs_no_exception.py
seems to fail whiletest_pytz_fakefs_no_exception.py
seems to succeed and I just don't understand why the API would be so stringent. Anyway, thought I'd file it here if it were considered to be a bug.I've attached the test cases to this ticket, thank you for taking a look.
tests.zip
Pytest/pyfakefs version:
$> pytest --version This is pytest version 3.9.3, imported from /usr/local/lib/python3.6/dist-packages/pytest.py setuptools registered plugins: pytest-mock-1.10.0 at /usr/local/lib/python3.6/dist-packages/pytest_mock.py pyfakefs-3.5 at /usr/local/lib/python3.6/dist-packages/pyfakefs/pytest_plugin.py
Python version:
$> python3 --version Python 3.6.6
The text was updated successfully, but these errors were encountered: