Hi, I'm testing your super apple but got an error with the pytest in "15 : Unit Testing FastAPI Routes". Can you have a look ?
My repository is : https://github.com/frchalaoux/cleanmysurface
(melange_py310) frchalaoux$ pytest
============================================= test session starts ==============================================
platform darwin -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0
rootdir: /Users/frchalaoux/Documents/Drone/RAndD/Dev/cleanmysurface/backend
plugins: anyio-3.5.0
collected 1 item
tests/test_routes/test_users.py F [100%]
=================================================== FAILURES ===================================================
_______________________________________________ test_create_user _______________________________________________
client = <starlette.testclient.TestClient object at 0x7ffab8964a00>
def test_create_user(client) -> None:
"""_summary_
Args:
client (_type_): _description_
"""
data = {"username":"testuser","email":"testuser@nofoobar.com","is_active": "True", "password":"testing"}
> response = client.post("/users/",json.dumps(data))
E TypeError: TestClient.post() takes 2 positional arguments but 3 were given
tests/test_routes/test_users.py:11: TypeError
=========================================== short test summary info ============================================
FAILED tests/test_routes/test_users.py::test_create_user - TypeError: TestClient.post() takes 2 positional ar...
============================================== 1 failed in 0.15s ===============================================
cheers, François-Régis
PS: I have exactly the same type of errors when I run pytest with your code !
Hi, I'm testing your super apple but got an error with the pytest in "15 : Unit Testing FastAPI Routes". Can you have a look ?
My repository is : https://github.com/frchalaoux/cleanmysurface
cheers, François-Régis
PS: I have exactly the same type of errors when I run pytest with your code !