I am using quite a bit of “vibe”-ish coding at my new job. I actually like it, but…
Some day I will probably write a proper post about it, but for now I’ll write a rant.
Generally speaking, Cursor is pretty good at generating unit tests, but very far from perfect. It tries to test private functions, forgets to unmock the mocks, et cetera, et cetera, but… It’s biggest fear is using the simple concept of “assert actual equals expected” when it comes to structured values in Python.
I already told it to use deepdiff library for the comparisons. It still insists on asserting the length of the array and value of each field individually , but just now it gave me a real gem.
self.assertEqual(sum(len(p.outputs) for p in result.phases), 1) # <==== this!
self.assertIsInstance(result.phases[0].outputs[0], SomeSuchResult)
self.assertEqual(result.phases[0].outputs[0].name, "/Shared/analysis")
Sum of all output lengths, eh? It’s so ugly, it is beautiful in its own right. So, like, we want one phase with exactly one output, but we don’t care which one. I am not sure if it asserted that there was exactly one phase somewhere above that, this version is already gone. Either way, taking the sum is a hilariously stupid idea.
So much for AI coders replacing real ones. But hey, it works, the test passes!
