One of the guys at my old job submitted a PR with tests that basically just mocked everything, tested nothing. Like,
with patch("something.whatever", return_value=True): assert whatever(0) is True assert whatever(1) is True
Except for a few dozen lines, with names that made it look like they were doing useful.
He used AI to generate them, of course. Pretty useless.
Flamekebab@piefed.social 6 months ago
I’ve seen it generate working unit tests plenty. In the sense that they pass.
…they do not actually test the functionality.
Of course that function returns what you’re asserting - you overwrote its actual output and checked against that!