Follow

If you're switching your code to use pytest or unittest instead of the no longer maintained nosetest and you notice that not all of your tests are being gathered up the problem may be that you used foo_test instead of test_foo in a random assortment of your functions.

When this happens sed is your best friend:

sed -i "s/def \(.*\)_test/def test_\1/" ./tests/*py

@bcl

regex-Chun and sed-Fu are the martial art styles that will save your life in more situations than you ever might expect <3

Sign in to participate in the conversation
Infosec Exchange

A Mastodon instance for info/cyber security-minded people.