Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.61 KB

testing.md

File metadata and controls

32 lines (23 loc) · 1.61 KB

Package Testing

We try to cover the most crucial functionality with unit tests using UnitTesting. To run the tests locally, you should install UnitTesting via Package Control.

Run the test specs locally

First you need to clone GitSavvy repo from source. Open the directory GitSavvy and simply run the command UnitTesting: Test Current Project

Some details about DeferrableTestCase

DeferrableTestCase is used to write the test cases. They are executed by the DeferringTextTestRunner and the runner expects not only regular test functions, but also generators. If the test function is a generator, it does the following

  • if the yielded object is a callable, the runner will evaluate the callable and check its returned value. If the result is True, the runner continues the generator, if not, the runner will wait until the condition is met.

  • If the yielded object is an integer, say x, then it will continue the generator after x ms.

  • Otherwise, the yield statement will always wait for 10 ms.