============================= test session starts ============================= platform win32 -- Python 3.13.5, pytest-9.0.2, pluggy-1.6.0 rootdir: C:\Users\megaa\Downloads\drone_env configfile: pyproject.toml plugins: anyio-4.12.1 collected 15 items tests\test_api.py .F..........FF. [100%] ================================== FAILURES =================================== __________________________________ test_root __________________________________ def test_root(): r = client.get("/") assert r.status_code == 200 > data = r.json() ^^^^^^^^ tests\test_api.py:26: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\AppData\Local\Programs\Python\Python313\Lib\site-packages\httpx\_models.py:832: in json return jsonlib.loads(self.content, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\..\AppData\Local\Programs\Python\Python313\Lib\json\__init__.py:346: in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\..\AppData\Local\Programs\Python\Python313\Lib\json\decoder.py:345: in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = s = '\n\n\n\n\n\n\n' idx = 0 def raw_decode(self, s, idx=0): """Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. """ try: obj, end = self.scan_once(s, idx) except StopIteration as err: > raise JSONDecodeError("Expecting value", s, err.value) from None E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ..\..\AppData\Local\Programs\Python\Python313\Lib\json\decoder.py:363: JSONDecodeError ____________________________ test_analyse_endpoint ____________________________ def test_analyse_endpoint(): r = client.get("/analyse/easy_delivery") assert r.status_code == 200 data = r.json() # Either has data or the "no episodes yet" message > assert "task" in data or "error" in data E AssertionError: assert ('task' in {'action_distribution': {'DOWN': 79, 'LEFT': 52, 'RIGHT': 76, 'UP': 72, ...}, 'avg_deliveries': '0.3', 'avg_reward': -3.4, 'avg_steps': 34.5, ...} or 'error' in {'action_distribution': {'DOWN': 79, 'LEFT': 52, 'RIGHT': 76, 'UP': 72, ...}, 'avg_deliveries': '0.3', 'avg_reward': -3.4, 'avg_steps': 34.5, ...}) tests\test_api.py:127: AssertionError __________________________ test_analyse_unknown_task __________________________ def test_analyse_unknown_task(): r = client.get("/analyse/nonexistent") > assert r.status_code == 404 E assert 200 == 404 E + where 200 = .status_code tests\test_api.py:132: AssertionError =========================== short test summary info =========================== FAILED tests/test_api.py::test_root - json.decoder.JSONDecodeError: Expecting... FAILED tests/test_api.py::test_analyse_endpoint - AssertionError: assert ('ta... FAILED tests/test_api.py::test_analyse_unknown_task - assert 200 == 404 ======================== 3 failed, 12 passed in 10.19s ========================