← Back to team overview

testtools-dev team mailing list archive

[Question #263535]: Using testr unable to discover native python test-scripts

 

New question #263535 on testtools:
https://answers.launchpad.net/testtools/+question/263535

I am newbie to testr.

I have a package with following directory and coding structure:

testpkg
------------
     |
     |
     |__init__.py
     |
     |--- libraries for the testcases(3 such files)
     |
     | --- test suite files
           |
           | -- testclass(name same as test_suite filename)
                      |-- each testcase is a definition  inside the testclass

With above structure, I want to run the testcases using testr.

If I define the '.testr.conf' as below, then it runs all the tests inside the testsuite 'tc_pc' but reports FAILED, although the testsuite has ALL PASSED testcases. I am suspecting that testr expects a returncode which my testsuite is not returning
[DEFAULT]
test_command=python tc_pc.py discover . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

If I  want to testr to discover all testuites or testcases available in the 'testpkg', then it does not discover any testcase, because nothing is returned on 'testr  list-tests' . Here is my config

[DEFAULT]
test_command=python -m subunit.run discover testpkg $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

Btw.. I am running testr from the 'testpkg' directory

What changes or what am I need to correct to achieve what I intend to do ? Any input

-- 
You received this question notification because you are a member of
testtools developers, which is an answer contact for testtools.