-1

By I get all of my test cases under one test suite nosetests. Is it possible to configure nose to create testsuite for each module it loads tests from.

For example if I have a system like:

packageA
    moduleA
        testA
        testB
        testC
    moduleB
        testA
        testB

Upon running nose, I get:

nosetests
    testA
    testB
    testC
    testA
    testB

I am wondering if I can configure nose to output:

moduleA
    testA
    testB
    testC
moduleB
    testA
    testB

As it provides easier resolution of test cases.

Suryavanshi
  • 595
  • 1
  • 7
  • 24
  • You may want to mention in your question that you are using Jenkins with junit publishing, and include a snapshot of what you do not like about it. – Oleksiy May 22 '14 at 00:54

1 Answers1

0

You can do it, but you would have to write a custom plugin for it, see writing nose plugins. A low tech solution would simply print "moduleA" in setup_module, but you would have to run your tests with -s and deal with all stdout that would not be captured. What is more important is that once you make your tests run in some type of continuous integration (Jenkins works nicely) you will start using --with-xunit and the resulting xml file does organize files by the module structure.

Oleksiy
  • 6,337
  • 5
  • 41
  • 58
  • I am currently using this `--with-xunit` and in `Jenkins`, but am unable to get the desired result. – Suryavanshi May 22 '14 at 00:14
  • 1
    Have you tired running multiple nosetests (one per module), outputting into seperate xml files? You may want to check out https://wiki.jenkins-ci.org/display/JENKINS/Multi+Module+Tests+Publisher – Oleksiy May 22 '14 at 00:47
  • Creating a separate nosetest for each module is the last resort. I am looking for a solution that allows me to execute nosetest once and tells nose to store results on a per module basis. I guess their is no off shelf solution available as of now. – Suryavanshi May 22 '14 at 01:51