question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unit test failures in 2.3.2

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AMDmi3commented, Oct 19, 2022

Fix confirmed, thank you!

1reaction
d0c-s4vagecommented, Jul 15, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Magento 2.3.2 default magento unit test failed - Stack Overflow
I am using magento 2.3.2 version and my php version is 7.2, i ran unit test command for default magento , the command...
Read more >
2.3 Unit Testing - Java extreme programming - eTutorials.org
This new test fails, because you have not written the new feature yet. You then implement the new feature and run all of...
Read more >
Why Your JUnit 5 Tests Are Not Running Under Maven
There is a very common issue preventing your JUnit 5 tests from running under Maven. In this post, I explain why and provide...
Read more >
2.3. Testing & continuous integration - DynSem - Spoofax
DynSem can automatically generate a JUnit test harness which ... Testsimpl Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.278...
Read more >
Changelog - testthat
Fixed an issue that could prevent compilation of Catch unit tests with ... Test results show hyperlinks to failed expectation when supported ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found