Skip to content

Conversation

@sobolevn
Copy link
Member

This function is rather important, we need to add more tests if it is not covered, not ignore it.

Let's see the results.

@sobolevn sobolevn force-pushed the refactor-default_deserializer branch from d8f6657 to 39cec47 Compare October 12, 2025 06:55
@codecov
Copy link

codecov bot commented Oct 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.78%. Comparing base (d478219) to head (39cec47).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4430      +/-   ##
==========================================
- Coverage   97.83%   97.78%   -0.05%     
==========================================
  Files         296      296              
  Lines       15286    15308      +22     
  Branches     1711     1720       +9     
==========================================
+ Hits        14955    14969      +14     
- Misses        189      196       +7     
- Partials      142      143       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4430

@sobolevn
Copy link
Member Author

@sobolevn
Copy link
Member Author

@provinzkraut I have a hard time figuring out how to actually test this 🤔
Any ideas? :)

@provinzkraut
Copy link
Member

provinzkraut commented Oct 12, 2025

Hmm. For L119-L124 there exists a case that should cover this:

def test_validate_subscribed_generics() -> None:

At least that's the test added in #3519, which introduced these lines in the first place.

Apparently it's not testing what it's supposed to be testing. Maybe this is a test regression, and that case is getting caught somewhere upstream now?

Would be a good starting point for investigating I think.

@euri10
Copy link
Contributor

euri10 commented Oct 12, 2025

def test_x() -> None:
    d = default_deserializer(list[int], [1,2,3,4])
    assert d == [1,2,3,4]

this takes the red path I think, or you're talking about the line 125-126 ?

@sobolevn
Copy link
Member Author

@provinzkraut this test does not trigger the red path :(
I started with it.

@euri10 I guess that this test it so not quite correct, because we don't use default_deserializer directly, it is an internal callback. I have to somehow trigger it from a layer above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants