🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

nose-selecttests

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nose-selecttests

Specify whitelist of keywords for tests to be run by nose

0.5
PyPI
Maintainers
1

Simple nose plugin that enables developers to run subset of collected tests to spare some waiting time for better things.

Supports Python 2.x and 3.x, see .travis.yml for specific versions being tested.

Usage

Examples of using the plugin on the plugin package itself:

Run all tests::

$ nosetests -v

test_configure_complex (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_empty_string (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_none (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_case_insensitive (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_negative (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_unselected (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_unselected_override (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_wildcard (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_options (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_prepareTestCase_exclude (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_prepareTestCase_select (noseselecttests.tests.NoseSelectPluginTest) ... ok

----------------------------------------------------------------------
Ran 13 tests in 0.008s

OK

Only run tests with keyword configure::

$ nosetests -v -t configure

test_configure_complex (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_empty_string (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_none (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok

----------------------------------------------------------------------
Ran 4 tests in 0.006s

OK

Case insensitive::

$ nosetests -v -t CONFIGURE

test_configure_complex (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_empty_string (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_none (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok

----------------------------------------------------------------------
Ran 4 tests in 0.006s

OK

Only run tests with keyword configure but exclude tests with keyword complex::

$ nosetests -v -t configure -e complex

test_configure_empty_string (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_none (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.006s

OK

Multiple keywords resolve to OR operation::

$ nosetests -v -t none -t simple

test_configure_none (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_is_selected_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.018s

OK

To just exclude some tests, use -e which is provided by nose itself::

$ nosetests -v -e is_selected

test_configure_complex (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_empty_string (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_none (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_configure_simple (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_options (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_prepareTestCase_exclude (noseselecttests.tests.NoseSelectPluginTest) ... ok
test_prepareTestCase_select (noseselecttests.tests.NoseSelectPluginTest) ... ok

----------------------------------------------------------------------
Ran 7 tests in 0.005s

OK

History

0.5 (2016-02-22)

  • Python 3 support [Domen Kožar]

0.4 (2013-08-27)

  • Fixed bug to avoid running class fixtures if a test is not selected. [Philippe Ombredanne]

  • Added PluginTester tests [Philippe Ombredanne]

0.3 (2012/12/29)

  • Removed code for excluding tests (-e already does that) [Domen Kožar]

  • Don't select all tests that have None as test name (could be a module level SkipTest) [Domen Kožar]

0.2 (2012/07/27)

  • Report SyntaxErrors instead of crashing [Domen Kožar]

0.1 (2012/07/08)

  • initial release [Domen Kožar]

nose-selecttests Copyright (c) 2012, Domen Kožar All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts