Skip to content

valermor/nose2-tests-recipes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOSE2 Test recipes

Collections of examples on how to use advanced features of nose2.

Filtering tests using attrib plugin

This makes use of the attrib plugin.

The groups decorator sets the attributes group or groups in the tests that is decorated. When the tests are run, the attrib plugin will look for those attributes in the tests methods.

Examples

    run_multiple_group_tests.sh
    run_single_group_tests.sh

Running tests concurrently

This makes use of the multiprocess plugin. The concurrency level is set either in the N flag passed to nose2 command or in the nose2 config file.

Beware of this issue: if the extent of the concurrency is greater than the number of tests, your tests will hang. E.g. N=5 but there are only 4 tests, your test run will never exit.

Beware of this issue: if there is any import error you will not be able to see it when mp is on: logging gets swallowed. You need to disable the plugin for debugging.

Example

    run_concurrent_tests.sh

Parameterized tests

This makes use of the params plugin. In the example, test values are stored in a class. Different providers are defined which inject data into the tests.

Example

    run_parameterized_tests.sh

License

The code in this project is distributed under the provision of the Apache License 2.0.

About

A collection of recipes for the advanced usage of nose2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published