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
$ python -m pytest
========================================================= test session starts =========================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /tmp/shellinghamplugins: mock-3.11.1
collected 1 item
tests/test_posix.py F [100%]
============================================================== FAILURES ===============================================================
__________________________________________________ test_get_shell[mapping0-result0] ___________________________________________________
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f928f57d8d0>, environ = <test_posix.EnvironManager object at 0x7f9290491550>
mapping = {'1480': Process(args=('/Applications/iTerm.app/Contents/MacOS/iTerm2', '--server', 'login', '-fp', 'keegan'), pid='14...s=('screen',), pid='1556', ppid='1482'), '1558': Process(args=('-/usr/local/bin/bash',), pid='1558', ppid='1557'), ...}
result = ('bash', '==MOCKED=LOGIN=SHELL==/bash')
@pytest.mark.parametrize('mapping, result', [
( # Based on pypa/pipenv#2496, provided by @keegancsmith.MAPPING_EXAMPLE_KEEGANCSMITH, ('bash', '==MOCKED=LOGIN=SHELL==/bash'),
),
])
deftest_get_shell(mocker, environ, mapping, result):
environ.patch(SHELL='==MOCKED=LOGIN=SHELL==/bash')
> mocker.patch.object(posix, '_get_process_mapping', return_value=mapping)
tests/test_posix.py:86:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.11/site-packages/pytest_mock/plugin.py:255: in object
returnself._start_patch(
.venv/lib/python3.11/site-packages/pytest_mock/plugin.py:220: in _start_patch
mocked: MockType = p.start()
/usr/lib/python3.11/unittest/mock.py:1591: in start
result =self.__enter__()
/usr/lib/python3.11/unittest/mock.py:1443: in __enter__
original, local =self.get_original()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <unittest.mock._patch object at 0x7f928f5cb850>
defget_original(self):
target =self.getter()
name =self.attribute
original =DEFAULT
local =Falsetry:
original = target.__dict__[name]
except (AttributeError, KeyError):
original =getattr(target, name, DEFAULT)
else:
local =Trueif name in _builtins andisinstance(target, ModuleType):
self.create =Trueifnotself.create and original isDEFAULT:
> raise AttributeError(
"%s does not have the attribute %r"% (target, name)
)
E AttributeError: <module 'shellingham.posix' from '/tmp/shellingham/.venv/lib/python3.11/site-packages/shellingham/posix/__init__.py'> does not have the attribute '_get_process_mapping'
/usr/lib/python3.11/unittest/mock.py:1416: AttributeError
======================================================= short test summary info =======================================================
FAILED tests/test_posix.py::test_get_shell[mapping0-result0] - AttributeError: <module 'shellingham.posix' from '/tmp/shellingham/.venv/lib/python3.11/site-packages/shellingham/posix/__init__.p...
========================================================== 1 failed in 0.16s ==========================================================
This is on Gentoo Linux amd64, Python 3.11.4, shellingham 1.5.3 (b8ba512).
bisect blames 7bf9e76. Indeed, it seems that _get_process_mapping() was removed there.
Also, it seems that CI doesn't actually run tests, since only test env runs tests, and CI runs all the other envs that apparently only install the package.
The text was updated successfully, but these errors were encountered:
mgorny
changed the title
tests/test_posix.py::test_get_shell[mapping0-result0] fails with 1.5.3
tests/test_posix.py::test_get_shell[mapping0-result0] fails with 1.5.2+
Aug 17, 2023
This is on Gentoo Linux amd64, Python 3.11.4, shellingham 1.5.3 (b8ba512).
bisect blames 7bf9e76. Indeed, it seems that
_get_process_mapping()
was removed there.Also, it seems that CI doesn't actually run tests, since only
test
env runs tests, and CI runs all the other envs that apparently only install the package.The text was updated successfully, but these errors were encountered: