I didn’t know it was required having a file called unittesting.json
in the root of the package. When I had tried the easyclang test suite i just assumed that UnitTesting was making its magic because that plugin had a folder called tests… So it’s good UnitTesting allows you to specify where the tests are placed.
That said, I’ve tried right now testing wbond’s newterm package so i’ve created this unittesting.json
file in the root of the newterm directory such as:
{
"tests_dir" : "dev",
"pattern" : "test*.py",
"async": true,
"deferred": false,
"verbosity": 5,
"output": "<panel>",
"capture_console": true
}
I’ve called UnitTesting: Test Current Package ...
from the command pannel and then just used UnitTesting
command. As a result I’ve got:
tests (unittest.loader.ModuleImportFailure) ... ERROR
======================================================================
ERROR: tests (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./python3.3/unittest/case.py", line 384, in _executeTestPart
File "./python3.3/unittest/loader.py", line 32, in testFailure
ImportError: Failed to import test module: tests
Traceback (most recent call last):
File "./python3.3/unittest/loader.py", line 261, in _find_tests
File "./python3.3/unittest/loader.py", line 239, in _get_module_from_name
File "D:\software\SublimeText 3_x64\Data\Packages\newterm\dev\tests.py", line 13, in <module>
from .unittest_data import data, data_class
SystemError: Parent module '' not loaded, cannot perform relative import
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
UnitTesting: Done.
So, do you know how to test newterm’s package?
Btw, I wonder how @wbond tested newterm… there isn’t any unittesting.json file in that package so maybe he used another method to test it out.