Add unit testing via pytest (#987)

* Add pytest to project

Includes a couple sample tests, a note in CONTRIBUTING, and inclusion in the makefile

* Include pytest in Travis build
This commit is contained in:
Micah Jerome Ellison 2020-06-20 14:30:15 -07:00 committed by GitHub
parent e4f1453cc9
commit 8d702fee9d
6 changed files with 153 additions and 3 deletions

View file

@ -94,10 +94,12 @@ A typical development workflow includes:
When resolving bugs or adding new functionality, please add tests to prevent that functionality from breaking in the future. If you notice any functionality that isn't covered in the tests, feel free to submit a test-only pull request as well.
For testing, jrnl uses [behave](https://behave.readthedocs.io/) tests, which are all in the `features` folder.
For integration testing, jrnl uses [behave](https://behave.readthedocs.io/) tests, which are all in the `features` folder.
Many tests can be created by only editing `feature` files with the same format as other tests. For more complicated functionality, you may need to implement steps in `features/steps` which are then executed by your tests in the `feature` files.
Starting in 2020, jrnl is also using [pytest](https://docs.pytest.org/) for unit tests. These tests are in the `tests` folder.
### Submitting pull requests
When you're ready, feel free to submit a pull request (PR). The jrnl maintainers generally review the pull requests every two weeks, but the continuous integration pipeline will run on automated tests on it within a matter of minutes and will report back any issues it has found with your code across a variety of environments.