Add pytest unit tests to `data_builder`
See original GitHub issueIt would be great to have some unit tests for the methods in data_builder
to help find edge cases in data formatting. I’m happy to start up a suite using pytest - please let me know if I should proceed and I’ll start a PR.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Getting Started Unit Testing with Pytest - Towards Data Science
Our very first test will test a simple addition function. We will put this code in a file called project.py . def add(a,...
Read more >Improve Tests with the Builder Pattern for Test Data | Blog
The Unit Test Data Builder Pattern ... encapsulation in OO designs, you don't want to add friction that makes it harder to modify...
Read more >How to Create a Test Data Builder | Code With Arho
Learn how to use the test data builder pattern to make it easy to create objects for tests. Learn how to reduce boilerplate...
Read more >Unit testing with pytest - Crunching the Data
In this article we discuss using unit tests for data science projects. Specifically, we talk about using the pytest module in python to...
Read more >Test Data Builders and Object Mother: another look
Test Data Builder uses the Builder pattern to create objects in Unit Tests. A short reminder of a Builder : The builder pattern...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ShaynaCummings this looks good to me. If you’re available for more test ideas, here are some that would rely on running
process_md_texts
:links
fields.state
fields.name
fields.That branch looks ready for a PR…
@ShaynaCummings if you prefer - you can just commit the tests and I’ll hook them up to the github action, or you can cover that in your PR as well.
https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions
To test the action, fork the repo, author your new test action, make a PR to your fork, and check if the tests pass or don’t based on what’s in the PR. The PR should show a nice big red X or green circle I think if everything got glued. There might even be a way to output exactly which tests failed on which data points.