Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

testSet assertion on unexpected "No error information" #30

Open
@craftyguy

Description

@craftyguy

This test fails on python 3.10 (not sure if it is specific to python 3.10 or not...)

test/keyutils_test.py .....F...                                                                                                                                                                                  [100%]

======================================================================================================= FAILURES =======================================================================================================
__________________________________________________________________________________________________ BasicTest.testSet ___________________________________________________________________________________________________

self = <test.keyutils_test.BasicTest testMethod=testSet>

    def testSet(self):
        keyDesc = b"test:key:01"
        keyVal = b"key value with\0 some weird chars in it too"
        keyring = keyutils.KEY_SPEC_THREAD_KEYRING

        # Key not initialized; should get None
        keyId = keyutils.request_key(keyDesc, keyring)
        self.assertEqual(keyId, None)

        self.assertRaises(keyutils.Error, keyutils.read_key, 12345)
        try:
>           keyutils.read_key(12345)

test/keyutils_test.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

keyId = 12345

    def read_key(keyId):
>       return _keyutils.read_key(keyId)

keyutils/__init__.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   PyErr_SetFromErrno(error)
E   keyutils._keyutils.error: (126, 'No error information')

keyutils/_keyutils.pyx:199: error

During handling of the above exception, another exception occurred:

self = <test.keyutils_test.BasicTest testMethod=testSet>

    def testSet(self):
        keyDesc = b"test:key:01"
        keyVal = b"key value with\0 some weird chars in it too"
        keyring = keyutils.KEY_SPEC_THREAD_KEYRING

        # Key not initialized; should get None
        keyId = keyutils.request_key(keyDesc, keyring)
        self.assertEqual(keyId, None)

        self.assertRaises(keyutils.Error, keyutils.read_key, 12345)
        try:
            keyutils.read_key(12345)
        except keyutils.Error as e:
>           self.assertEqual(e.args, (126, 'Required key not available'))
E           AssertionError: Tuples differ: (126, 'No error information') != (126, 'Required key not available')
E
E           First differing element 1:
E           'No error information'
E           'Required key not available'
E
E           - (126, 'No error information')
E           + (126, 'Required key not available')

test/keyutils_test.py:39: AssertionError
=============================================================================================== short test summary info ================================================================================================
FAILED test/keyutils_test.py::BasicTest::testSet - AssertionError: Tuples differ: (126, 'No error information') != (126, 'Required key not available')
============================================================================================= 1 failed, 8 passed in 1.75s ==============================================================================================

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions