Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

python Quart test_client AttributeError: 'coroutine' object has no attribute 'headers' #413

Copy link
Copy link
@khteh

Description

@khteh
Issue body actions

conftest.py:

import pytest
import os, sys
from src.main import app
from os.path import dirname, join, abspath
sys.path.insert(0, abspath(join(dirname(__file__), '../src')))

@pytest.fixture
def client():
    return app.test_client()

my_test.py:

def test_fibonacci_pass(client):
    response = client.get('/api/v1/fibonacci?n=10', follow_redirects=True)
>       assert response.headers['content-type'] == "text/html; charset=utf-8"
E       AttributeError: 'coroutine' object has no attribute 'headers'

Environment:

  • Python version: 3.12.7
  • Quart version:
$ pipenv graph | grep -i quart
quart-cors==0.8.0
└── Quart 
quart-flask-patch==0.3.0
└── Quart 
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.