Test file code for my fastapi app. Using Mas Os
from fastapi.testclient import TestClient
import json
import os
import sys
sys.append.path(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from main import app
client = TestClient(app)
# email already exists
def test_createAccount_existing_User():
input_data = {"first_name":"first", "last_name":"last", "email":"user@example2.com", "password":"1234"}
response = client.post('/account/', json.dump(input_data))
assert response.status_code == 400
Error that I am getting:
ERROR test_userRoute.py - AttributeError: module 'sys' has no attribute 'append'
When I am running pytest -v, showing error in the terminal.