Incorrect retrieval of mutation cached status
Opened this issue · 3 comments
Lines 441 to 442 in 53d4aa1
When there are duplicate lines in the file, the program uses cache of the first of such lines. Instead should be used line_number
Well no, it can't use the line number, because mutmut is built to handle when line number changes due to edits to the file.
Could you show an example of having the same code in multiple lines? That seems pretty strange to me.
But updates of line numbers occur on the early stages, meaning that the lines are up to date during read of cache.
Here are the examples, I've faced while testing Flask:
https://github.com/pallets/flask/blob/d0bf462866289ad8bfe29b6e4e1e0f531003ab34/src/flask/blueprints.py#L531
https://github.com/pallets/flask/blob/d0bf462866289ad8bfe29b6e4e1e0f531003ab34/src/flask/blueprints.py#L550
Guess that there can be other situations when lines are similar.
Ah. That's a good point. I'm open to a PR.