Closed Glandos closed 1 year ago
Not yet identified
Not yet identified
It's great that you are considering moving away from Flask-Testing and exploring other options for writing tests in Flask. As you mentioned, using fixtures with pytest is a popular approach for testing Flask applications.
In addition to pytest, there are other testing frameworks that you may want to consider, such as nose or unittest2. However, pytest is widely used and offers many features that make it a popular choice among developers.
To get started with using pytest for testing Flask, you can take a look at the official Flask documentation on testing with pytest (https://flask.palletsprojects.com/en/2.1.x/testing/pytest/). This guide provides an overview of how to use pytest with Flask, including how to create test fixtures, how to write tests using the Flask test client, and how to run tests using pytest.
In general, moving to pytest involves refactoring your existing tests to use pytest fixtures and syntax. This may take some time, but it can provide significant benefits in terms of test organization, readability, and maintainability.
Some benefits of using pytest over Flask-Testing include:
Pytest offers a more powerful and flexible testing framework, with many built-in features for test discovery, test organization, and test execution. Pytest has a large and active community, with many plugins and extensions available for customizing and extending its functionality. Pytest is compatible with many other testing tools and frameworks, making it easy to integrate with your existing development workflow. Overall, moving to pytest can be a great way to improve your testing process and ensure that your Flask applications are robust, reliable, and easy to maintain.
Currently, we are using pytest for launching tests, but they are all written with Flask-Testing and unittest.
Since Flask-Testing is nearly dead, and Flask is moving fastly, we should move away from it, and use another way to write test. As far as I can tell, the base documentation for testing Flask can easily use fixtures of pytest.
In this issue, I want to discuss what we are currently using, and what could be done to move to pytest.
However, there might be other library I'm not aware of.