I wanted to refine my testing code a bit, but got stuck all weekend long. I use nosetest and have a function to create requests_mock, where I read data from local files. https://github.com/peshay/tpm/blob/testrefine/tests/test_tpm.py The issue is here with line 35, my nosetest call hangs on this and I have no idea what’s the issue and how to chase it. I tried to put this particular relevant code in an own test file, but there it works. As soon as I remove the json.loads nosetests run. I also tried some different ways to read the data from the file twice, or with data_file.seek(0), but it also hangs on this call. Can someone give me a hint what could be wrong here?
The issue was not with json.loads, it was the following while loop.
while True:
if data_len > item_limit and isinstance(data,list):
In this loop data_len should have been changed, but never was, so it never came to it's break point.