The source in hypothesis_test.py, I have:
from utils import collapse_contiguous_ranges, check_number_in_range
@given(st.lists(st.integers()))
def test_collapse_contiguous_ranges(range: list[int]):
collapsed = collapse_contiguous_ranges(range)
for i in range:
assert check_number_in_range(i, collapsed)
assert collapse_contiguous_ranges(range) == [range[0], range[-1]]
Here is my command and my error:
python -u "/Users/pitosalas/mydev/public-131-samples/memsim/memsim/tests/hypothesis_test.py"
Traceback (most recent call last):
File "/Users/pitosalas/mydev/public-131-samples/memsim/memsim/tests/hypothesis_test.py", line 3, in <module>
from utils import collapse_contiguous_ranges, check_number_in_range
ModuleNotFoundError: No module named 'utils'
And here is my directory structure. I've been stuck here before in other apps. I always mess around and sometimes it starts working. What can I try next?

python -m memsim.tests.hypothesis_testfrom the uppermemsimdirectory, and change the import tofrom memsim.utils import ...Then you will have a consistentsys.paththat should work reliably.utils.pyis not in the same directory ashypothesis_test.py. Can you say why you expected the import to work?