(app, client)
| 746 | |
| 747 | |
| 748 | def test_teardown_request_handler(app, client): |
| 749 | called = [] |
| 750 | |
| 751 | @app.teardown_request |
| 752 | def teardown_request(exc): |
| 753 | called.append(True) |
| 754 | return "Ignored" |
| 755 | |
| 756 | @app.route("/") |
| 757 | def root(): |
| 758 | return "Response" |
| 759 | |
| 760 | rv = client.get("/") |
| 761 | assert rv.status_code == 200 |
| 762 | assert b"Response" in rv.data |
| 763 | assert len(called) == 1 |
| 764 | |
| 765 | |
| 766 | def test_teardown_request_handler_debug_mode(app, client): |