thomas commited on
Commit
7f20e53
·
1 Parent(s): 25fe19a

feature(#13): update pytest.

Browse files
Files changed (1) hide show
  1. tests/conftest.py +6 -5
tests/conftest.py CHANGED
@@ -1,13 +1,14 @@
1
  import pytest
2
- from app import create_app
 
3
 
4
 
5
  @pytest.fixture(scope="module")
6
  def test_client():
7
- flask_app = create_app()
8
-
9
  # Create a test client using the Flask application configured for testing
10
- with flask_app.test_client() as testing_client:
11
  # Establish an application context
12
- with flask_app.app_context():
13
  yield testing_client # this is where the testing happens!
 
1
  import pytest
2
+ from fastapi import FastAPI
3
+ from fastapi.testclient import TestClient
4
 
5
 
6
  @pytest.fixture(scope="module")
7
  def test_client():
8
+ app = FastAPI()
9
+ client = TestClient(app)
10
  # Create a test client using the Flask application configured for testing
11
+ with client as testing_client:
12
  # Establish an application context
13
+ with client.app:
14
  yield testing_client # this is where the testing happens!