Created
April 19, 2020 17:02
-
-
Save ryanc414/feeae7eda3253cac69af6aba65442558 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.fixture | |
def app(): | |
app = App() | |
print("Starting app") | |
app.start() | |
yield app | |
print("Stopping app") | |
app.stop() | |
def test_app(app): | |
"""Test making an HTTP request to my app.""" | |
rsp = requests.get(f"{app.listen_addr}/hello") | |
assert rsp.status_code == 200 | |
assert rsp.text == 'Hello, "/hello"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment