Reputation: 471
Does anyone know the least hacky way of determining if Python code is being run by a unit test?
Thanks!
Upvotes: 2
Views: 75
Reputation: 19030
I agree with all the comments.
Don't do this.
Your function/class/component should NOT behave differently under testing.
Upvotes: 1