Bug 2275251

Summary: python-remoto fails to build with pytest 8: AttributeError: 'TestRemoteError' object has no attribute 'traceback'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-remotoAssignee: Ken Dreyer <ktdreyer>
Status: POST --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 42CC: fsimonce, jcaratza, ktdreyer, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2256331    

Description Tomáš Hrnčiar 2024-04-16 09:17:22 UTC
python-remoto fails to build with pytest 8.

=================================== FAILURES ===================================
_________________ TestExtendPath.test_no_environment_sets_path _________________

self = <remoto.tests.test_process.TestExtendPath object at 0x7f1244a40fe0>

    def test_no_environment_sets_path(self):
        fake_conn = Mock()
        fake_conn.gateway.remote_exec.return_value = fake_conn
        fake_conn.receive.return_value = {}
        result = process.extend_env(fake_conn, {})
>       assert result['env']['PATH'] == self.path
E       AttributeError: 'TestExtendPath' object has no attribute 'path'

remoto/tests/test_process.py:18: AttributeError
___________ TestExtendPath.test_custom_path_does_not_get_overridden ____________

self = <remoto.tests.test_process.TestExtendPath object at 0x7f124431a7e0>

    def test_custom_path_does_not_get_overridden(self):
        fake_conn = Mock()
        fake_conn.gateway.remote_exec.return_value = fake_conn
        fake_conn.receive.return_value = {'PATH': '/home/alfredo/bin'}
        result = process.extend_env(fake_conn, {})
        new_path = result['env']['PATH']
>       assert new_path.endswith(self.path)
E       AttributeError: 'TestExtendPath' object has no attribute 'path'

remoto/tests/test_process.py:26: AttributeError
___________ TestExtendPath.test_custom_env_var_extends_existing_env ____________

self = <remoto.tests.test_process.TestExtendPath object at 0x7f1243fa9970>

    def test_custom_env_var_extends_existing_env(self):
        fake_conn = Mock()
        fake_conn.gateway.remote_exec.return_value = fake_conn
        fake_conn.receive.return_value = {'PATH': '/home/alfredo/bin'}
        result = process.extend_env(fake_conn, {'extend_env': {'CEPH_VOLUME_DEBUG': '1'}})
        new_path = result['env']['PATH']
>       assert result['env']['PATH'].endswith(self.path)
E       AttributeError: 'TestExtendPath' object has no attribute 'path'

remoto/tests/test_process.py:35: AttributeError
_____________________ TestRemoteError.test_exception_name ______________________

self = <remoto.tests.test_util.TestRemoteError object at 0x7f1243fa9d30>

    def test_exception_name(self):
>       error = util.RemoteError(self.traceback)
E       AttributeError: 'TestRemoteError' object has no attribute 'traceback'

remoto/tests/test_util.py:29: AttributeError
_____________________ TestRemoteError.test_exception_line ______________________

self = <remoto.tests.test_util.TestRemoteError object at 0x7f1243fa9f40>

    def test_exception_line(self):
>       error = util.RemoteError(self.traceback)
E       AttributeError: 'TestRemoteError' object has no attribute 'traceback'

remoto/tests/test_util.py:33: AttributeError
=========================== short test summary info ============================
FAILED remoto/tests/test_process.py::TestExtendPath::test_no_environment_sets_path
FAILED remoto/tests/test_process.py::TestExtendPath::test_custom_path_does_not_get_overridden
FAILED remoto/tests/test_process.py::TestExtendPath::test_custom_env_var_extends_existing_env
FAILED remoto/tests/test_util.py::TestRemoteError::test_exception_name - Attr...
FAILED remoto/tests/test_util.py::TestRemoteError::test_exception_line - Attr...
========================= 5 failed, 47 passed in 0.08s =========================

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07248792-python-remoto/

For all our attempts to build python-remoto with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/python-remoto/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Tomáš Hrnčiar 2024-04-17 07:37:00 UTC
PR: https://src.fedoraproject.org/rpms/python-remoto/pull-request/3

Comment 2 Aoife Moloney 2025-02-26 13:01:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.