3 ms·
py.test does the magic walking, and it does indeed make for much less verbose tests -- no need to remember which self.assertSomething method to call either:
by Erwin 9y ago
py.test does the magic walking, and it does indeed make for much less verbose tests -- no need to remember which self.assertSomething method to call either:
x = 1
y = 2
items = [4,5,6]
assert (x+y) in items
Outputs this, replacing the variable names with values
test.py:4: in <module>
assert (x+y) in items
E assert (1 + 2) in [4, 5, 6]
- techdragon 9y agoIf you aren't using pytest, you don't know what your missing. It cleans up so much of the testing boilerplate for python.
- bpicolo 9y agoThough the magical global dependency injection is still somewhat obtuse, and not overly new-team-member friendly