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

py.test fails under Windows if using py >= 1.5.0 #330

Closed
mrbean-bremen opened this Issue Nov 15, 2017 · 3 comments

Comments

Projects
None yet
1 participant
@mrbean-bremen
Collaborator

mrbean-bremen commented Nov 15, 2017

Appveyor tests currently fail with while testing test ptest plugin with:

%PYTHON%\Scripts\py.test.exe pytest_plugin_test.py
============================= test session starts
platform win32 -- Python 2.7.14, pytest-3.2.5, py-1.5.1, pluggy-0.4.0
rootdir: C:\projects\pyfakefs, inifile:
plugins: pyfakefs-3.4
collected 1 item
pytest_plugin_test.py E
=================================== ERRORS ====================================
______________________ ERROR at setup of test_fs_fixture ______________________
request = <SubRequest 'fs' for <Function 'test_fs_fixture'>>
@pytest.fixture
def fs(request):
""" Fake filesystem. """

  patcher = Patcher()

c:\python27-x64\lib\site-packages\pyfakefs\pytest_plugin.py:22:


c:\python27-x64\lib\site-packages\pyfakefs\fake_filesystem_unittest.py:286: in init
self._findModules()


self = <pyfakefs.fake_filesystem_unittest.Patcher object at 0x000000000361B208>
def _findModules(self):
"""Find and cache all modules that import file system modules.
Later, setUp() will stub these with the fake file system
modules.
"""
for name, module in set(sys.modules.items()):
if (module in self.SKIPMODULES or
(not inspect.ismodule(module)) or
name.split('.')[0] in self._skipNames):
continue
# IMPORTANT TESTING NOTE: Whenever you add a new module below, test
# it by adding an attribute in fixtures/module_with_attributes.py
# and a test in fake_filesystem_unittest_test.py, class
# TestAttributesWithFakeModuleNames.

      if inspect.ismodule(module.__dict__.get('os')):

E ImportError: No module named syslog
c:\python27-x64\lib\site-packages\pyfakefs\fake_filesystem_unittest.py:328: ImportError

This does not happen with the same pytest version, but a py version < 1.5.0.
This may be a bug in py, or in our usage code.

mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Nov 15, 2017

@mrbean-bremen

This comment has been minimized.

Show comment
Hide comment
@mrbean-bremen

mrbean-bremen Nov 15, 2017

Collaborator

I installed a working py version in the appveyor tests to make the tests green, but we have to understand the problem.

Collaborator

mrbean-bremen commented Nov 15, 2017

I installed a working py version in the appveyor tests to make the tests green, but we have to understand the problem.

@mrbean-bremen

This comment has been minimized.

Show comment
Hide comment
@mrbean-bremen

mrbean-bremen Nov 15, 2017

Collaborator

Ok, there is an error filed in py.
I will wait a while what happens with that (the bug has been filed recently).
Update: there is already a PR created that fixes this, including the update to 1.5.2.
I will wait until the pypi release and check if Appveyor will install the correct version implicitely afterwards.

Collaborator

mrbean-bremen commented Nov 15, 2017

Ok, there is an error filed in py.
I will wait a while what happens with that (the bug has been filed recently).
Update: there is already a PR created that fixes this, including the update to 1.5.2.
I will wait until the pypi release and check if Appveyor will install the correct version implicitely afterwards.

@mrbean-bremen

This comment has been minimized.

Show comment
Hide comment
@mrbean-bremen

mrbean-bremen Nov 16, 2017

Collaborator

py has been fixed and released in version 1.5.2. Appveyor uses the new version for Python 2.7 and 3.6 builds, which succeed, but not for 3.3 build - that still fails.

Collaborator

mrbean-bremen commented Nov 16, 2017

py has been fixed and released in version 1.5.2. Appveyor uses the new version for Python 2.7 and 3.6 builds, which succeed, but not for 3.3 build - that still fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment