Skip to content

Implement tests #16

Closed
Closed

Description

@aaron-junot

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.

Activity

  1. apex-omontgomery commented on Oct 17, 2018

    @apex-omontgomery
    Contributor

    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

  2. lemonsaurus commented on Oct 20, 2018

    @lemonsaurus

    unittest is 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.

  3. aaron-junot commented on Oct 22, 2018

    @aaron-junot
    MemberAuthor

    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.

  4. apex-omontgomery commented on Oct 22, 2018

    @apex-omontgomery
    Contributor

    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

  5. apex-omontgomery commented on Oct 22, 2018

    @apex-omontgomery
    Contributor

    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?

  6. lemonsaurus commented on Oct 22, 2018

    @lemonsaurus

    Testing all the routes is a good place to start, in my opinion.

  7. aaron-junot commented on Oct 22, 2018

    @aaron-junot
    MemberAuthor

    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

  8. aaron-junot commented on Oct 25, 2018

    @aaron-junot
    MemberAuthor

    The testing framework has been implemented. Who wants to write some tests?

  9. aaron-junot commented on Dec 24, 2018

    @aaron-junot
    MemberAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions