tito / telenium

Automation for Kivy Application
MIT License
67 stars 23 forks source link

tearDownClass() failure #25

Open DenisDarahan opened 2 years ago

DenisDarahan commented 2 years ago

Sometimes (about 1 time in several runs) tests end with a JSONDecodeError. Here is the full trace:

Failure
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/suite.py", line 290, in _tearDownPreviousClass
    tearDownClass()
  File "/Users/denisdarahan/PycharmProjects/NewProject/venv/lib/python3.9/site-packages/telenium/tests.py", line 126, in tearDownClass
    cls.stop_process()
  File "/Users/denisdarahan/PycharmProjects/NewProject/venv/lib/python3.9/site-packages/telenium/tests.py", line 114, in stop_process
    cls.cli.app_quit()
  File "/Users/denisdarahan/PycharmProjects/NewProject/venv/lib/python3.9/site-packages/telenium/client.py", line 53, in __call__
    response.json()["error"]["message"])
  File "/Users/denisdarahan/PycharmProjects/NewProject/venv/lib/python3.9/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Actually it happens because response.text is an empty line.