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

Bug: test failures #3481

Closed
2 of 4 tasks
peterschutt opened this issue May 9, 2024 · 0 comments · Fixed by #3497
Closed
2 of 4 tasks

Bug: test failures #3481

peterschutt opened this issue May 9, 2024 · 0 comments · Fixed by #3497
Labels
Bug 🐛 This is something that is not working as expected

Comments

@peterschutt
Copy link
Contributor

peterschutt commented May 9, 2024

Description

The tests ran right around midnight UTC time.

________________ test_default_serializer[v1-condate-2024-05-08] ________________
[gw0] linux -- Python 3.8.18 /home/runner/work/litestar/litestar/.venv/bin/python

model = ModelV1(custom_str='', custom_int=0, custom_float=0.0, custom_list=[], custom_set=CustomSet(), custom_frozenset=Custom...scheme='some', host='example.org', tld='org', host_type='domain', path='/'), http_url=HttpUrl('http://example.org/', ))
attribute_name = 'condate', expected = '2024-05-08'

    @pytest.mark.parametrize(
        "attribute_name, expected",
        [
            ("path", "example"),
            ("email_str", "info@example.org"),
            ("name_email", "info <info@example.org>"),
            ("color", "white"),
            ("bytesize", 100),
            ("secret_str", "**********"),
            ("secret_bytes", "**********"),
            ("payment_card_number", "4000000000000002"),
            ("constr", "hello"),
            ("conbytes", b"hello"),
            ("condate", datetime.date.today().isoformat()),
            ("condecimal", 3.14),
            ("conset", {1}),
            ("confrozenset", frozenset([1])),
            ("conint", 1),
            ("url", "some://example.org/"),
            ("http_url", "http://example.org/"),
        ],
    )
    def test_default_serializer(model: ModelV1 | ModelV2, attribute_name: str, expected: Any) -> None:
>       assert serializer(getattr(model, attribute_name)) == expected
E       AssertionError: assert '2024-05-09' == '2024-05-08'
E         - 2024-05-08
E         ?          ^
E         + 2024-05-09
E         ?          ^

tests/unit/test_contrib/test_pydantic/test_plugin_serialization.py:203: AssertionError
________________ test_default_serializer[v2-condate-2024-05-08] ________________
[gw1] linux -- Python 3.8.18 /home/runner/work/litestar/litestar/.venv/bin/python

model = ModelV2(conset={1}, confrozenset=frozenset({1}), conlist=[1], path=PosixPath('example'), email_str='info@example.org',...ondecimal=Decimal('3.14'), confloat=1.0, conint=1, url=Url('some://example.org/'), http_url=Url('http://example.org/'))
attribute_name = 'condate', expected = '2024-05-08'

    @pytest.mark.parametrize(
        "attribute_name, expected",
        [
            ("path", "example"),
            ("email_str", "info@example.org"),
            ("name_email", "info <info@example.org>"),
            ("color", "white"),
            ("bytesize", 100),
            ("secret_str", "**********"),
            ("secret_bytes", "**********"),
            ("payment_card_number", "4000000000000002"),
            ("constr", "hello"),
            ("conbytes", b"hello"),
            ("condate", datetime.date.today().isoformat()),
            ("condecimal", 3.14),
            ("conset", {1}),
            ("confrozenset", frozenset([1])),
            ("conint", 1),
            ("url", "some://example.org/"),
            ("http_url", "http://example.org/"),
        ],
    )
    def test_default_serializer(model: ModelV1 | ModelV2, attribute_name: str, expected: Any) -> None:
>       assert serializer(getattr(model, attribute_name)) == expected
E       AssertionError: assert '2024-05-09' == '2024-05-08'
E         - 2024-05-08
E         ?          ^
E         + 2024-05-09
E         ?          ^

tests/unit/test_contrib/test_pydantic/test_plugin_serialization.py:203: AssertionError

and

_______________ test_default_serializer[v1-condate-2024-05-08] ________________
[gw0] win32 -- Python 3.12.3 D:\a\litestar\litestar\.venv\Scripts\python.exe

model = ModelV1(custom_str='', custom_int=0, custom_float=0.0, custom_list=[], custom_set=CustomSet(), custom_frozenset=Custom...scheme='some', host='example.org', tld='org', host_type='domain', path='/'), http_url=HttpUrl('http://example.org/', ))
attribute_name = 'condate', expected = '2024-05-08'

    @pytest.mark.parametrize(
        "attribute_name, expected",
        [
            ("path", "example"),
            ("email_str", "info@example.org"),
            ("name_email", "info <info@example.org>"),
            ("color", "white"),
            ("bytesize", 100),
            ("secret_str", "**********"),
            ("secret_bytes", "**********"),
            ("payment_card_number", "4000000000000002"),
            ("constr", "hello"),
            ("conbytes", b"hello"),
            ("condate", datetime.date.today().isoformat()),
            ("condecimal", 3.14),
            ("conset", {1}),
            ("confrozenset", frozenset([1])),
            ("conint", 1),
            ("url", "some://example.org/"),
            ("http_url", "http://example.org/"),
        ],
    )
    def test_default_serializer(model: ModelV1 | ModelV2, attribute_name: str, expected: Any) -> None:
>       assert serializer(getattr(model, attribute_name)) == expected
E       AssertionError: assert '2024-05-09' == '2024-05-08'
E         - 2024-05-08
E         ?          ^
E         + 2024-05-09
E         ?          ^

tests\unit\test_contrib\test_pydantic\test_plugin_serialization.py:203: AssertionError
_______________ test_default_serializer[v2-condate-2024-05-08] ________________
[gw0] win32 -- Python 3.12.3 D:\a\litestar\litestar\.venv\Scripts\python.exe

model = ModelV2(conset={1}, confrozenset=frozenset({1}), conlist=[1], path=WindowsPath('example'), email_str='info@example.org...ondecimal=Decimal('3.14'), confloat=1.0, conint=1, url=Url('some://example.org/'), http_url=Url('http://example.org/'))
attribute_name = 'condate', expected = '2024-05-08'

    @pytest.mark.parametrize(
        "attribute_name, expected",
        [
            ("path", "example"),
            ("email_str", "info@example.org"),
            ("name_email", "info <info@example.org>"),
            ("color", "white"),
            ("bytesize", 100),
            ("secret_str", "**********"),
            ("secret_bytes", "**********"),
            ("payment_card_number", "4000000000000002"),
            ("constr", "hello"),
            ("conbytes", b"hello"),
            ("condate", datetime.date.today().isoformat()),
            ("condecimal", 3.14),
            ("conset", {1}),
            ("confrozenset", frozenset([1])),
            ("conint", 1),
            ("url", "some://example.org/"),
            ("http_url", "http://example.org/"),
        ],
    )
    def test_default_serializer(model: ModelV1 | ModelV2, attribute_name: str, expected: Any) -> None:
>       assert serializer(getattr(model, attribute_name)) == expected
E       AssertionError: assert '2024-05-09' == '2024-05-08'
E         - 2024-05-08
E         ?          ^
E         + 2024-05-09
E         ?          ^

tests\unit\test_contrib\test_pydantic\test_plugin_serialization.py:203: AssertionError
============================== warnings summary ===============================
tests/unit/test_concurrency.py::test_sync_to_thread_trio
  D:\a\litestar\litestar\.venv\Lib\site-packages\trio\_core\_wakeup_socketpair.py:59: RuntimeWarning: It looks like Trio's signal handling code might have collided with another library you're using. If you're running Trio in guest mode, then this might mean you should set host_uses_signal_set_wakeup_fd=True. Otherwise, file a bug on Trio and we'll help you figure out what's going on.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ===========================
FAILED tests/unit/test_contrib/test_pydantic/test_plugin_serialization.py::test_default_serializer[v1-condate-2024-05-08] - AssertionError: assert '2024-05-09' == '2024-05-08'
  - 2024-05-08
  ?          ^
  + 2024-05-09
  ?          ^
FAILED tests/unit/test_contrib/test_pydantic/test_plugin_serialization.py::test_default_serializer[v2-condate-2024-05-08] - AssertionError: assert '2024-05-09' == '2024-05-08'
  - 2024-05-08
  ?          ^
  + 2024-05-09
  ?          ^
= 2 failed, 5043 passed, 169 skipped, 7 xfailed, 5 xpassed, 1 warning in 72.62s (0:01:12) =

https://github.com/litestar-org/litestar/actions/runs/9010091640/job/24755515232
https://github.com/litestar-org/litestar/actions/runs/9010091640/job/24755515608

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

No response

Litestar Version

main

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@peterschutt peterschutt added the Bug 🐛 This is something that is not working as expected label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 This is something that is not working as expected
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

1 participant