Skip to content
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

Errors in testing #17

Closed
brunothedev opened this issue Dec 6, 2022 · 3 comments
Closed

Errors in testing #17

brunothedev opened this issue Dec 6, 2022 · 3 comments

Comments

@brunothedev
Copy link

I am currently trying to package python-xkbcommon to void linux, but at the test it shows this:

============================= test session starts ==============================
platform linux -- Python 3.11.0, pytest-7.1.3, pluggy-1.0.0
rootdir: /builddir/python3-xkbcommon-0.4
collected 68 items

tests/test_xkb.py .......................................FF............. [ 79%]
............FF                                                           [100%]

=================================== FAILURES ===================================
_______________________ TestBitEnum.test_StateComponent ________________________

self = <tests.test_xkb.TestBitEnum testMethod=test_StateComponent>

    def test_StateComponent(self):
        a = xkb.XKB_STATE_MODS_DEPRESSED
        b = xkb.XKB_STATE_MODS_LATCHED
        self.assertIsInstance(a | b, xkb.StateComponent)
>       self.assertEqual(str(a | b),
                         "StateComponent.XKB_STATE_MODS_LATCHED|XKB_STATE_MODS_DEPRESSED")
E       AssertionError: '3' != 'StateComponent.XKB_STATE_MODS_LATCHED|XKB_STATE_MODS_DEPRESSED'
E       - 3
E       + StateComponent.XKB_STATE_MODS_LATCHED|XKB_STATE_MODS_DEPRESSED

tests/test_xkb.py:232: AssertionError
_________________________ TestBitEnum.test_StateMatch __________________________

self = <tests.test_xkb.TestBitEnum testMethod=test_StateMatch>

    def test_StateMatch(self):
>       self.assertEqual(
            str(xkb.XKB_STATE_MATCH_ANY|xkb.XKB_STATE_MATCH_ALL
                |xkb.XKB_STATE_MATCH_NON_EXCLUSIVE),
            "StateMatch.XKB_STATE_MATCH_NON_EXCLUSIVE"
            "|XKB_STATE_MATCH_ALL"
            "|XKB_STATE_MATCH_ANY")
E       AssertionError: '65539' != 'StateMatch.XKB_STATE_MATCH_NON_EXCLUSIVE|[35 chars]_ANY'
E       - 65539
E       + StateMatch.XKB_STATE_MATCH_NON_EXCLUSIVE|XKB_STATE_MATCH_ALL|XKB_STATE_MATCH_ANY

tests/test_xkb.py:239: AssertionError
___________________ TestKeyboardState.test_state_update_key ____________________

self = <tests.test_xkb.TestKeyboardState testMethod=test_state_update_key>

    def test_state_update_key(self):
        state = self.km.state_new()
        self.assertEqual(
            state.mod_name_is_active("Lock", xkb.XKB_STATE_MODS_LOCKED),
            False)
        keydown = state.update_key(self.capslock, xkb.XKB_KEY_DOWN)
>       self.assertEqual(
            str(keydown),
            "StateComponent.XKB_STATE_LEDS"
            "|XKB_STATE_MODS_EFFECTIVE"
            "|XKB_STATE_MODS_LOCKED"
            "|XKB_STATE_MODS_DEPRESSED")
E       AssertionError: '269' != 'StateComponent.XKB_STATE_LEDS|XKB_STATE_M[56 chars]SSED'
E       - 269
E       + StateComponent.XKB_STATE_LEDS|XKB_STATE_MODS_EFFECTIVE|XKB_STATE_MODS_LOCKED|XKB_STATE_MODS_DEPRESSED

tests/test_xkb.py:269: AssertionError
___________________ TestKeyboardState.test_state_update_mask ___________________

self = <tests.test_xkb.TestKeyboardState testMethod=test_state_update_mask>

    def test_state_update_mask(self):
        master_state = self.km.state_new()
        slave_state = self.km.state_new()
        master_state.update_key(self.capslock, xkb.XKB_KEY_DOWN)
        master_state.update_key(self.capslock, xkb.XKB_KEY_UP)
        depressed_mods = master_state.serialize_mods(
            xkb.XKB_STATE_MODS_DEPRESSED)
        latched_mods = master_state.serialize_mods(
            xkb.XKB_STATE_MODS_LATCHED)
        locked_mods = master_state.serialize_mods(
            xkb.XKB_STATE_MODS_LOCKED)
        depressed_layout = master_state.serialize_layout(
            xkb.XKB_STATE_LAYOUT_DEPRESSED)
        latched_layout = master_state.serialize_layout(
            xkb.XKB_STATE_LAYOUT_LATCHED)
        locked_layout = master_state.serialize_layout(
            xkb.XKB_STATE_LAYOUT_LOCKED)
        self.assertEqual(
            slave_state.mod_name_is_active("Lock", xkb.XKB_STATE_MODS_LOCKED),
            False)
        r = slave_state.update_mask(
            depressed_mods, latched_mods, locked_mods,
            depressed_layout, latched_layout, locked_layout)
>       self.assertEqual(
            str(r),
            "StateComponent.XKB_STATE_LEDS"
            "|XKB_STATE_MODS_EFFECTIVE"
            "|XKB_STATE_MODS_LOCKED")
E       AssertionError: '268' != 'StateComponent.XKB_STATE_LEDS|XKB_STATE_MODS_EFFECTIVE|XKB_STATE_MODS_LOCKED'
E       - 268
E       + StateComponent.XKB_STATE_LEDS|XKB_STATE_MODS_EFFECTIVE|XKB_STATE_MODS_LOCKED

tests/test_xkb.py:308: AssertionError
=========================== short test summary info ============================
FAILED tests/test_xkb.py::TestBitEnum::test_StateComponent - AssertionError: ...
FAILED tests/test_xkb.py::TestBitEnum::test_StateMatch - AssertionError: '655...
FAILED tests/test_xkb.py::TestKeyboardState::test_state_update_key - Assertio...
FAILED tests/test_xkb.py::TestKeyboardState::test_state_update_mask - Asserti...
========================= 4 failed, 64 passed in 0.27s =========================

Unfortunately, there seems to be no documentation on installing from source, so i think i cannot fix this issue on my on, so i am asking for help

@sde1000
Copy link
Owner

sde1000 commented Dec 6, 2022

Hmm. I think I need to find a python 3.11 test environment to check this out — I don't have any platforms with python 3.11 readily available yet.

I suspect all of these test failures are to do with the change of behaviour of enum.IntFlag.__str__() in python 3.11 — see https://docs.python.org/3/library/enum.html#enum.IntFlag

@brunothedev
Copy link
Author

The reason i created this issue was to maintain a package on void linux,but now that i am leaving void linux, i don't have a reason to maintain this package and fix this issue, more details here: void-linux/void-packages#40837

@sde1000
Copy link
Owner

sde1000 commented Jan 11, 2023

I've just released version 0.5 that fixes the issue with python 3.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants