Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swatch class has no tests #1

Closed
terriko opened this issue Feb 9, 2021 · 5 comments
Closed

Swatch class has no tests #1

terriko opened this issue Feb 9, 2021 · 5 comments
Labels
good first issue Good for newcomers

Comments

@terriko
Copy link
Owner

terriko commented Feb 9, 2021

We should add some basic unittests in the tests directory to make sure the calculations make sense.

@terriko terriko added the good first issue Good for newcomers label Feb 9, 2021
@HVFrancis
Copy link
Contributor

Do you want this done using pytest or some other test runner (or does it matter)?

@terriko
Copy link
Owner Author

terriko commented May 18, 2021

Pytest please!

@HVFrancis
Copy link
Contributor

Any specific tests you want to make sure are in there?

@terriko
Copy link
Owner Author

terriko commented May 18, 2021

I'd start by making sure it worked as expected for real measurements (if you don't know what those look like, there's some at the bottom of https://blog.tincanknits.com/2013/08/17/gauge/ and that page explains what swatching is for), then start in on anything needed to trigger other code paths. (I usually use some sort of code coverage tool to check this)

We don't currently have error handling, but you could also build tests for values like 0 and -1 and strings that aren't numbers and possibly change the code to behave appropriately.

@ben-hampson
Copy link
Contributor

then start in on anything needed to trigger other code paths. (I usually use some sort of code coverage tool to check this)

@terriko could you explain to me what this means? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants