Package: skipnose
Nose plugin which allows to include/exclude directories for testing
by their glob pattern. This allows to selectively filter which
tests are executed.UsingPlugin adds 3 configuration options tonosetests:--with-skipnoseRequired option to enableskipnoseplugin functionality.
Alternatively can be provided as an environment variableNOSE_SKIPNOSE(e.g. add this to.bashrc-export NOSE_SKIPNOSE=1).--skipnose-excludeThis option specifies using glob pattern any folders which nosetests
should ignore. This option can also be provided multiple times and
alternatively can be provided as a[,;:]-delimitedNOSE_SKIPNOSE_EXCLUDEenvironment variable:$ nosetests --with-skipnose --skipnose-exclude=foo3 --skipnose-exclude=sub2foo?
$ # is equivalent to
$ NOSE_SKIPNOSE_EXCLUDE=foo3,sub2foo? nosetests --with-skipnosewhich would result in the following folders being excluded in the tests:tests/
  foo1/
    sub1foo1/
      ...
    sub2foo1/             <= excluded
      ...
  foo2/
    sub1foo2/
      ...
    sub2foo2/             <= excluded
      ...
  foo3/                   <= excluded
    sub1foo3/             <= excluded
      ...
    sub2foo3/             <= excluded
      ...--skipnose-includeThis option specifies using glob pattern the only folders nosetests
should run. This option can also be provided multiple times.
Each given parameter clause will be ANDed.
Within each parameter:delimited  clauses will be ORed.
In addition this parameter can be provided as a[,;:]-delimited ([,;]for AND and[:]for OR)NOSE_SKIPNOSE_INCLUDEenvironment variable:$ nosetests --with-skipnose --skipnose-include=foo3 --skipnose-include=sub2foo?
$ # is equivalent to
$ NOSE_SKIPNOSE_INCLUDE=foo3,sub2foo? nosetests --with-skipnosewhich would result in only the following folders being included in the tests:tests/
  foo1/
    sub1foo1/
      ...
    sub2foo1/
      ...
  foo2/
    sub1foo2/
      ...
    sub2foo2/
      ...
  foo3/                   <= only this will run
    sub1foo3/
      ...
    sub2foo3/             <= only this will run
      ...Here is an example when clauses are ORed:$ nosetests --with-skipnose --skipnose-include=foo3:sub2foo?
$ # is equivalent to
$ NOSE_SKIPNOSE_INCLUDE=foo3:sub2foo? nosetests --with-skipnosewhich would result in only the following folders being included in the tests:tests/
  foo1/
    sub1foo1/
      ...
    sub2foo1/             <= only this will run
      ...
  foo2/
    sub1foo2/
      ...
    sub2foo2/             <= only this will run
      ...
  foo3/                   <= only this will run
    sub1foo3/             <= only this will run
      ...
    sub2foo3/             <= only this will run
      ...--skipnose-skip-testsThis option allows to skip specific test cases via json file.
The provided value should be a path to a json file with"skip_tests"key in json which should contain a list of test case names to skip.--skipnose-debugThis option enabled some extra print statements for debugging
to see which folders skipnose includes or excludes.DifferenceNose already has some options to include and exclude directories by using-ior-eoptions. The exclude mostly works as in this plugin
however the difference can be observed in include functionality.
Let’s consider the following folder tree structure:tests/
  foo/
    api/                      <= need only subtree
      subapi/
        ...
  bar/
    api/                      <= need only subtree
      ...Now lets imagine that we need to run only tests withintests/foo/api/andtests/bar/api/. To accomplish that, we would try to provide a regex
similar to"api"however that will not work because while determining
whether to go inside eitherfooorbardirectories, nose will not
match the regex pattern hence will not execute required tests. To solve
that, we might provide a more complex regex to account for this such as^tests/(foo)|(bar)/apihowever that could be more error-prone since
all paths to theapipaths will need to be accounted for.skipnosesolve this from the first try by just specifying a simple include
pattern"api"(e.g.--skipnose-include=api) and it will just work.
Internally before rejecting any folder,skipnosematches all directories
within the folder in question subtree. In order words, before rejectingtests/foo,skipnosewill test it’s subtree for the given glob pattern
which will find a match attests/foo/apihencetest/foowill not be
rejected. In addition, before rejectingtests/foo/api/subapisincesubapiwould not match the pattern,skipnosetests any of the parent
folders which will allow thesubapito be accepted.Hopefully this behaviour makes including specific folders and their subtree
in the test runner a lot more intuitive and simpler to configure.TestingTo run the tests you need to install testing requirements first:$ pip install -r requirements-dev.txtThen to run tests, you can usenosetests:$ nosetests -svHistory0.3.1 (2017-07-28)Using wheels for distributionExcluding tests from being installedAdded importanize as CI step0.3.0 (2017-02-18)New--skipnose-includeclauses now can either be ANDed or ORed.ANDed example:--skipnose-include=foo  --skipnose-include=barORed example:--skipnose-include=foo:bar0.2.0 (2016-02-24)Newadded--skipnose-skip-testsoption0.1.2 (2015-04-29)Fixed installation bug which prevented skipnose being installed
already installed nose.
See#1.0.1.1 (2014-09-02)Restructured project using cookiecutter templatePython3 and PYPY support0.1.0 (2014-08-01)Initial releaseCreditsThis utility was created atDealerTrack Technologies(DealerTrack GitHub) for our internal use so thank you
DealerTrack for allowing to contribute the utility
to the open-source community.Development LeadMiroslav Shubernetskiy -https://github.com/miki725ContributorsBen Homnick -https://github.com/bhomnickLicenseThe MIT License (MIT)Copyright (c) 2014 Dealertrack TechnologiesPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.