FTBFS: wtforms-alchemy has test failures on Lunar

Bug #2000011 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wtforms-alchemy (Ubuntu)
New
Undecided
Unassigned
wtforms-json (Ubuntu)
New
Undecided
Unassigned

Bug Description

wtforms-alchemy 0.18.0-3 currently fails to build on Ubuntu Lunar due to three failing tests, see error message below.

This build failure does not occur when attempting to build on Debian Sid, so while I haven't figured out what the difference is, it seems to be Ubuntu-only.

Log snippet (for more details see https://launchpadlibrarian.net/638902241/buildlog_ubuntu-lunar-amd64.wtforms-alchemy_0.18.0-3_BUILDING.txt.gz):

=================================== FAILURES ===================================
_____ TestModelColumnToFormFieldTypeConversion.test_choice_type_with_enum ______

self = <tests.test_types.TestModelColumnToFormFieldTypeConversion object at 0x7ff9da6c70a0>

    def test_choice_type_with_enum(self):
        class Choice(Enum):
            choice1 = 1
            choice2 = 2

            def __str__(self):
                return self.name

        self.init(type_=ChoiceType(Choice))
        self.assert_type('test_column', SelectField)
> assert self.form_class().test_column.choices == [
            (1, 'choice1'), (2, 'choice2')
        ]
E AssertionError: assert [<Choice.choi...e.choice2: 2>] == [(1, 'choice1...2, 'choice2')]
E At index 0 diff: <Choice.choice1: 1> != (1, 'choice1')
E Use -v to get more diff

tests/test_types.py:274: AssertionError
_ TestModelColumnToFormFieldTypeConversion.test_choice_type_with_enum_uses_custom_coerce_func[int-impl0] _

self = <tests.test_types.TestModelColumnToFormFieldTypeConversion object at 0x7ff9da6c4fd0>
type_ = <class 'int'>, impl = Integer()

    @mark.parametrize(
        ['type_', 'impl'],
        [
            (int, sa.Integer()),
            (str, sa.String())
        ]
    )
    def test_choice_type_with_enum_uses_custom_coerce_func(self, type_, impl):
        class Choice(Enum):
            choice1 = type_(1)
            choice2 = type_(2)

            def __str__(self):
                return self.name

        self.init(type_=ChoiceType(Choice, impl=impl))
        self.assert_type('test_column', SelectField)
        model = self.ModelTest(test_column=type_(2))
        form = self.form_class(obj=model)
> assert '<option selected value="2">' in str(form.test_column)

tests/test_types.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/wtforms/fields/core.py:149: in __str__
    return self()
/usr/lib/python3/dist-packages/wtforms/fields/core.py:172: in __call__
    return self.meta.render_field(self, kwargs)
/usr/lib/python3/dist-packages/wtforms/meta.py:64: in render_field
    return field.widget(field, **render_kw)
/usr/lib/python3/dist-packages/wtforms/widgets/core.py:351: in __call__
    for val, label, selected in field.iter_choices():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <wtforms_components.fields.select.SelectField object at 0x7ff9d90fc0d0>

    def iter_choices(self):
        """
        We should update how choices are iter to make sure that value from
        internal list or tuple should be selected.
        """
> for value, label in self.concrete_choices:
E TypeError: cannot unpack non-iterable Choice object

/usr/lib/python3/dist-packages/wtforms_components/fields/select.py:45: TypeError
_ TestModelColumnToFormFieldTypeConversion.test_choice_type_with_enum_uses_custom_coerce_func[str-impl1] _

self = <tests.test_types.TestModelColumnToFormFieldTypeConversion object at 0x7ff9da6c74f0>
type_ = <class 'str'>, impl = String()

    @mark.parametrize(
        ['type_', 'impl'],
        [
            (int, sa.Integer()),
            (str, sa.String())
        ]
    )
    def test_choice_type_with_enum_uses_custom_coerce_func(self, type_, impl):
        class Choice(Enum):
            choice1 = type_(1)
            choice2 = type_(2)

            def __str__(self):
                return self.name

        self.init(type_=ChoiceType(Choice, impl=impl))
        self.assert_type('test_column', SelectField)
        model = self.ModelTest(test_column=type_(2))
        form = self.form_class(obj=model)
> assert '<option selected value="2">' in str(form.test_column)

tests/test_types.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/wtforms/fields/core.py:149: in __str__
    return self()
/usr/lib/python3/dist-packages/wtforms/fields/core.py:172: in __call__
    return self.meta.render_field(self, kwargs)
/usr/lib/python3/dist-packages/wtforms/meta.py:64: in render_field
    return field.widget(field, **render_kw)
/usr/lib/python3/dist-packages/wtforms/widgets/core.py:351: in __call__
    for val, label, selected in field.iter_choices():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <wtforms_components.fields.select.SelectField object at 0x7ff9d94b8160>

    def iter_choices(self):
        """
        We should update how choices are iter to make sure that value from
        internal list or tuple should be selected.
        """
> for value, label in self.concrete_choices:
E TypeError: cannot unpack non-iterable Choice object

/usr/lib/python3/dist-packages/wtforms_components/fields/select.py:45: TypeError
=========================== short test summary info ============================
FAILED tests/test_types.py::TestModelColumnToFormFieldTypeConversion::test_choice_type_with_enum
FAILED tests/test_types.py::TestModelColumnToFormFieldTypeConversion::test_choice_type_with_enum_uses_custom_coerce_func[int-impl0]
FAILED tests/test_types.py::TestModelColumnToFormFieldTypeConversion::test_choice_type_with_enum_uses_custom_coerce_func[str-impl1]
=================== 3 failed, 244 passed, 1 xfailed in 1.32s ===================

Tags: ftbfs lunar
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

In turn, wtforms-alchemy's build failure prevents wtforms-json from building due to missing dependency.

summary: - FTBFS: test failures on Lunar
+ FTBFS: wtforms-alchemy has test failures on Lunar
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.