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

Unit test failures in 2.3.2 #126

Closed
reinerh opened this issue Aug 22, 2021 · 5 comments
Closed

Unit test failures in 2.3.2 #126

reinerh opened this issue Aug 22, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@reinerh
Copy link

reinerh commented Aug 22, 2021

Describe the bug
I'm trying to update the Debian package of lookatme to 2.3.2, but the build fails because of failing unit tests (with 2.3.0 it still succeeds):

I: pybuild base:232: cd /home/reiner/Source/debian/lookatme/lookatme/.pybuild/cpython3_3.9_lookatme/build; python3.9 -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-6.0.2, py-1.10.0, pluggy-0.13.0
rootdir: /home/reiner/Source/debian/lookatme/lookatme
plugins: cov-2.10.1, mock-1.10.4
collected 31 items

tests/test_cli.py ...                                                    [  9%]
tests/test_contrib.py .                                                  [ 12%]
tests/test_file_loader.py ....                                           [ 25%]
tests/test_markdown.py ...........                                       [ 61%]
tests/test_parse.py .....                                                [ 77%]
tests/test_schemas.py .FF.                                               [ 90%]
tests/test_table.py ...                                                  [100%]

=================================== FAILURES ===================================
__________________ test_sanity_check_that_errors_are_detected __________________

    def test_sanity_check_that_errors_are_detected():
        """Perform a sanity check that we can actually catch errors in generating
        the default schema values.
        """
        schema = MetaSchema()
    
        # force a discrepancy in the
        gend_default = MetaSchema().dump(None)
        gend_default["styles"]["padding"]["left"] = 100
    
        with pytest.raises(AssertionError) as excinfo:
>           _validate_field_recursive("__root__.styles", schema.styles.nested(), gend_default['styles'])
E           AttributeError: 'MetaSchema' object has no attribute 'styles'

tests/test_schemas.py:64: AttributeError
_____________________________ test_styles_defaults _____________________________

    def test_styles_defaults():
        """Ensure that style value defaults are generated correctly
        """
        schema = MetaSchema()
        gend_default = MetaSchema().dump(None)
>       _validate_field_recursive("__root__.styles", schema.styles.nested(), gend_default['styles'])
E       AttributeError: 'MetaSchema' object has no attribute 'styles'

tests/test_schemas.py:73: AttributeError
=============================== warnings summary ===============================
/usr/lib/python3/dist-packages/marshmallow/fields.py:173: 72 warnings
  /usr/lib/python3/dist-packages/marshmallow/fields.py:173: RemovedInMarshmallow4Warning: The 'default' argument to fields is deprecated. Use 'dump_default' instead.
    warnings.warn(

/usr/lib/python3/dist-packages/marshmallow/fields.py:181: 16 warnings
  /usr/lib/python3/dist-packages/marshmallow/fields.py:181: RemovedInMarshmallow4Warning: The 'missing' argument to fields is deprecated. Use 'load_default' instead.
    warnings.warn(

/usr/lib/python3/dist-packages/marshmallow/fields.py:218
  /usr/lib/python3/dist-packages/marshmallow/fields.py:218: RemovedInMarshmallow4Warning: Passing field metadata as a keyword arg is deprecated. Use the explicit `metadata=...` argument instead.
    warnings.warn(

.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
.pybuild/cpython3_3.9_lookatme/build/tests/test_schemas.py::test_meta_defaults
  /usr/lib/python3/dist-packages/marshmallow/fields.py:438: RemovedInMarshmallow4Warning: The 'default' attribute of fields is deprecated. Use 'dump_default' instead.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_schemas.py::test_sanity_check_that_errors_are_detected - At...
FAILED tests/test_schemas.py::test_styles_defaults - AttributeError: 'MetaSch...
================== 2 failed, 29 passed, 98 warnings in 1.54s ===================
E: pybuild pybuild:353: test: plugin distutils failed with: exit code=1: cd /home/reiner/Source/debian/lookatme/lookatme/.pybuild/cpython3_3.9_lookatme/build; python3.9 -m pytest tests

Expected behavior
Unit tests are passing.

Environment (please complete the following information):

  • OS: Debian Linux (unstable)
  • Lookatme Version 2.3.2
@reinerh reinerh added the bug Something isn't working label Aug 22, 2021
@AMDmi3
Copy link
Contributor

AMDmi3 commented Apr 15, 2022

Confirmed the same problem on FreeBSD. Gotta add that marshmallow is 3.15.0 which is within supported range.

@d0c-s4vage
Copy link
Owner

Taking a look, thank you for reporting this! I'm seeing the same errors locally too.

I've had problems with marshmallow in the past having API breaking changes between minor versions. Seems like this is another one of those.

d0c-s4vage added a commit that referenced this issue Jul 17, 2022
d0c-s4vage added a commit that referenced this issue Jul 17, 2022
d0c-s4vage added a commit that referenced this issue Jul 17, 2022
@d0c-s4vage
Copy link
Owner

Should be good now, will cut another release later this week after I address some other issues

@AMDmi3
Copy link
Contributor

AMDmi3 commented Oct 19, 2022

Fix confirmed, thank you!

@d0c-s4vage
Copy link
Owner

Yay! I've been going through tickets and forgot to comment on this one since all of the recent work. Thanks for keeping tabs on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants