python - Should my unit tests also test third-party library/package features? -


i've started using unit tests , i'm trying figure out how comprehensive tests should be. 1 particular thing comes when use packages/libraries components subject tests of own. should carrying out similar tests on components myself, or should testing features i've added?

for example, suppose developing web app in python , i'm using wtforms validate input. should writing tests e.g. check behaviour when email input invalid, or when required field empty, etc, though wtforms contains own tests of form?

my gut feeling bit redundant, since can run wtforms test suite on installation myself, i'm not sure if it's kind of no-no assume tests good.

by definition unit's test responsability control behaviour of 1 single piece of code. responsability developper consistenly write unit test you (or team) develop.

when speak of testing wtforms, have no reason write unit tests it. can make sense write integration test control way use in context (your code context) gives expected results. can later smooth upgrade of external code, because first run integrations tests should warn of unexpected change.

you can use same framework unit , integration test, should know in castle each test lives , part controls.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -