question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add pytest unit tests to `data_builder`

See original GitHub issue

It 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ubershmekelcommented, Jun 6, 2020

@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:

  • No empty links fields.
  • No empty state fields.
  • No empty name fields.
  • More than 200 records found.

That branch looks ready for a PR…

0reactions
ubershmekelcommented, Jun 6, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found