Comments (2)
unittest.MagicMock and patch
Not yet identified
flask_testing.TestCase
- Could be replaced by a fixture to create the app, as before.
- Creating the database seems to be left as an exercise for the user.
unittest assertions
Not yet identified
from ihatemoney.
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.
from ihatemoney.
Related Issues (20)
- Deprecate 'latest' tag on docker hub HOT 2
- Werkzeug 2.3 incompatibility: AttributeError: 'NoneType' object has no attribute 'lower' HOT 4
- Use the ActivityPub protocol to federate usage across ihatemoney instances HOT 3
- Different behaviors while directly visit project URLs HOT 3
- Change project password as admin without knowing the old one HOT 1
- If I add something the confirmation overlay is over new entry
- E-Mail with the internal IP HOT 2
- Changing any settings is prevented when project has existing currency HOT 2
- Bill Type: Invalid Choice: could not coerce. HOT 3
- Adding invalid reimbursements can cause the debt solver to fail HOT 2
- Cannot install in dev mode with python 3.12 HOT 4
- Find a consistent name for the new "reimbursement" / "settlement" / "transfer" bill type HOT 8
- CSRF Token: The CSRF tokens do not match. HOT 1
- Figure out how to generate correct URLs in emails
- Feature request: users and permissions HOT 2
- Login with wrong password
- [Question] HOW to access the admin dashboard ? HOT 1
- [Feature request] Associate bank accounts to users HOT 6
- Merge translations HOT 1
- Best config for spambot-safe deployment ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ihatemoney.