Creating Some Tests: Running Tests
Learn how to test the game.
We'll cover the following...
We'll cover the following...
Next, we’ll create a function that puts the API through its paces to play a game. To do this, we’ll need to create some random strings to enter the username, a task we enable with the random_string function.
Testing the game one time
The test functions can then be tested using the flask shell. Here’s an example of what that might look like, starting in the langman directory.
This example shows us that we can interactively use the application with the flask shell command where the FLASK_APP environment variable has been specified. However, within that shell, we can’t simply run the tests. Instead, we’ll have ...