Skip to content

Commit 349a0a9

Browse files
committed
A little cleanup for our test client fixture
1 parent 546c2e0 commit 349a0a9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/ch14_testing/final/tests/test_client.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@
99
))
1010
sys.path.insert(0, container_folder)
1111

12+
import pypi_org.app
1213
from pypi_org.app import app as flask_app
1314

1415

1516
@pytest.fixture
1617
def client():
17-
flask_app.app.config['TESTING'] = True
18-
client = flask_app.app.test_client()
18+
flask_app.config['TESTING'] = True
19+
client = flask_app.test_client()
1920

2021
try:
21-
flask_app.register_blueprints()
22-
except:
22+
pypi_org.app.register_blueprints()
23+
except Exception as x:
24+
print(x)
2325
pass
2426

25-
flask_app.init_db()
26-
# client.post()
27+
pypi_org.app.setup_db()
28+
client.post()
2729

2830
yield client

0 commit comments

Comments
 (0)