You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have no unit tests. There is no way of verifying that when changes are made that it doesn't break something else. It might not be a bad idea to implement the unittest framework, but if there's a more flask-specific solution, that would work as well.
These are all viable options, though. The second option perhaps has some extra bells and whistles and lends itself to splitting the tests into multiple files, so I think that would be my choice, but really any of these would be fine.
We're going to ultimately require beginners to implement tests when they make a PR, so whichever test framework is easiest to use would be my choice. I don't have time to research them all right this second, but I would like to look into this. If anyone wants to state their opinion on the easiest to use, that would be appreciated.
I'd also like discussion on what unit tests we should add first. Do we add tests for ensuring the environment is ready, or do we start putting our routes in tests?
I think we should test the cli and routes since that's the majority of our business logic. Once we get the testing framework set up, we can add some issues with some missing tests and let newbies help out with that effort
I'm going to call this completed by #70. I'm going to add a separate issue for negative unit tests and another issue for testing all code paths/possibilities, but there's enough now for someone to go off of if they open up a PR and need to add a test for the feature
Activity
apex-omontgomery commentedon Oct 17, 2018
Pytest is frickin awesome, if you'd like to see how we did it with flask in the other repo you can view here:
https://github.com/OperationCode/operationcode_pyback/tree/master/tests
lemonsaurus commentedon Oct 20, 2018
unittestis what Miguel Grinberg uses in his fairly well known Flask books and tutorials, and it would do the job.There's also the Flask-Testing extension, which provides some nice high level features like abstracting certain common assertions.
Lastly, there's
pytest, which is what the official Flask tutorial suggests.These are all viable options, though. The second option perhaps has some extra bells and whistles and lends itself to splitting the tests into multiple files, so I think that would be my choice, but really any of these would be fine.
aaron-junot commentedon Oct 22, 2018
We're going to ultimately require beginners to implement tests when they make a PR, so whichever test framework is easiest to use would be my choice. I don't have time to research them all right this second, but I would like to look into this. If anyone wants to state their opinion on the easiest to use, that would be appreciated.
apex-omontgomery commentedon Oct 22, 2018
I know unit tests are difficult to setup at first. But we really need to prioritize this.
I'm going to make the call to use pytest
apex-omontgomery commentedon Oct 22, 2018
If anybody wants to see how we started tests on pyback with pytest here's an example.
https://github.com/OperationCode/operationcode_pyback
I'd also like discussion on what unit tests we should add first. Do we add tests for ensuring the environment is ready, or do we start putting our routes in tests?
lemonsaurus commentedon Oct 22, 2018
Testing all the routes is a good place to start, in my opinion.
aaron-junot commentedon Oct 22, 2018
I think we should test the cli and routes since that's the majority of our business logic. Once we get the testing framework set up, we can add some issues with some missing tests and let newbies help out with that effort
aaron-junot commentedon Oct 25, 2018
The testing framework has been implemented. Who wants to write some tests?
aaron-junot commentedon Dec 24, 2018
I'm going to call this completed by #70. I'm going to add a separate issue for negative unit tests and another issue for testing all code paths/possibilities, but there's enough now for someone to go off of if they open up a PR and need to add a test for the feature