ugh how do I tell codecov that a python match/case statement is exhaustive without a default case

you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 1 day ago (2 children)

@glyph um do what I consider best practice in any language and put a default with a throw in it for when future you adds a state but not a case? well that's what I always do anyway. 🤷‍♀️😺

  • source
  • hideshow 2 child comments
  • [–] [S] 1 point 1 day ago (1 child)

    @tekhedd the trouble is that eventually my type checker is going to fight with my coverage checker about this

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 day ago

    @glyph heh, I was just thinking that, yes coverage tool will complain about that. there's no way to test a line whose only purpose is to fail hard because it should not be reachable. options include annotating it for the coverage tester or.. ugh.. somehow injecting a test case to trigger it which..is ugly. yeah. sorry.this should be part of the language, I think. "unreachable_default:"

  • source
  • parent