I have some utility modules that are independent and too small (~20 lines) to warrant their own tests folder. Is there any convention to embed pytest tests in the same module with the code, to keep it all compact? Tests would not need to use any advanced pytest features (fixtures, scopes, etc.)
E.g.
"""My beautiful sum helper"""
def sum_helper(a, b):
return a+b
def test_sum_helper():
assert sum_helper(1, 2) == 3
I understand this convention might need a special launch argument for pytest command.