terriko / pyknit

A set of tools for knitters to create charts and eventually more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swatch class has no tests

terriko opened this issue · comments

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

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

Pytest please!

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

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.

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.