https://github.com/jinksi/testing-python
An example of testing Python code, used for a hacky hour workshop.
https://github.com/jinksi/testing-python
pytest python testing
Last synced: 3 months ago
JSON representation
An example of testing Python code, used for a hacky hour workshop.
- Host: GitHub
- URL: https://github.com/jinksi/testing-python
- Owner: Jinksi
- Created: 2021-11-12T02:22:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-12T02:22:48.000Z (over 4 years ago)
- Last Synced: 2025-01-12T19:44:34.866Z (over 1 year ago)
- Topics: pytest, python, testing
- Language: Jupyter Notebook
- Homepage:
- Size: 930 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Testing in Python example
Watch the recording of this hacky hour discussion to see the original failing test scenarios. These should all pass!
### Topics
- Static testing
- Assertions (Sanity Check)
- Unit testing
### Example task
- Load a CSV of bounding boxes ([Data from luderick-seagrass dataset](https://github.com/globalwetlands/luderick-seagrass))
- Find the center x point of each bounding box
- Calculate the mean of the center x points

## To run the example code
### Install requirements
- In terminal, run `pip install -r requirements.txt`
### Run Jupyter notebook
- In terminal, run `jupyter notebook`
- Alternatively, open with VSCode with Python extension
- Open [get_bbox_center.ipynb](get_bbox_center.ipynb)
### Run unit tests
- Unit tests are written in [utils_test.py](utils_test.py)
- In terminal, run `pytest`