pschanely / CrossHair

An analysis tool for Python that blurs the line between testing and type systems.
Other
996 stars 47 forks source link

Add assertion message handling in pytest cover command #218

Closed azewiusz closed 11 months ago

azewiusz commented 11 months ago

This is suggested solution to #217

pschanely commented 11 months ago

For reasons that would not at all be obvious to you, we need to realize symbolic values inside the on_path_complete callback. I've pushed a commit doing it this way.

You wouldn't have noticed this issue because it only becomes problematic when the exception message is itself symbolic (the unit test I added would fail otherwise).

I think pytest is matching against str() of the exception object also, so I think we should do the same. (though in simple cases I believe this is the same as str(exc.args[0]))

PTAL! Unless you have further suggestions, I'll get this merged into main!