nose-devs/nose — Issue #306: testmatch can not be set properly from config file
Author: jpellerin
Created: 2011-12-14 16:07:12+00:00
State: open

Files
{{{
$ cat test_bar.py
def test_foo():
assert True
$ cat nose.cfg
[nosetests]
verbosity=4
#match=".*test.*" #
#testmatch=".*test.*" #
testMatch=".*test.*" #
}}}

It is unclear to me what the problem is internally, but setting testmach
through the config file does not appear to work. I tried the variations
commented in the cfg file.
{{{
$ nosetests --config=nose.cfg --verbosity=1

----------------------------------------------------------------------
Ran 0 tests in 0.001s

OK
$ nosetests --match=".*test.*" .
----------------------------------------------------------------------
Ran 1 test in 0.002s

OK

}}}

Full debug from config run:
{{{
$ nosetests --match=".*test.*" .
----------------------------------------------------------------------
Ran 1 test in 0.002s

OK
chris@chris-laptop ~/prog/nose_dev/matchcfgtest $ nosetests
--config=nose.cfg nose.plugins.manager: DEBUG: Configuring plugins
nose.plugins.manager: DEBUG: Plugins enabled:
[,
,
]
nose.core: DEBUG: configured Config(addPaths=True, args=(),
configSection='nosetests', debug=None, debugLog=None, env={}, exclude=None,
files=[], getTestCaseNamesCompat=False, ignoreFiles=(<_sre.SRE_Pattern
object at 0xb7ba1180>, <_sre.SRE_Pattern object at 0xb7ba1128>,
<_sre.SRE_Pattern object at 0xb7d46ef8>), include=None, includeExe=False,
logStream=', mode 'w' at 0xb7dea0b0>,
loggingConfig=None, options=, parser=, plugins=, runOnInit=True, srcDirs=('lib', 'src'), stopOnError=False,
stream=', mode 'w' at 0xb7dea0b0>,
testMatch=<_sre.SRE_Pattern object at 0xb7b39728>,
testMatchPat='(?:^|[\\b_\\./-])[Tt]est', testNames=[], verbosity=4,
where=(), workingDir='/home/chris/prog/nose_dev/matchcfgtest')
nose.importer: DEBUG: Add path /home/chris/prog/nose_dev/matchcfgtest
nose.core: DEBUG: test loader is
nose.core: DEBUG: Test names are ('.',)
nose.core: DEBUG: createTests called with None
nose.loader: DEBUG: load from . (None)
nose.selector: DEBUG: Test name . resolved to file ., module None, call None
nose.selector: DEBUG: Final resolution of test name .: file
/home/chris/prog/nose_dev/matchcfgtest module None call None
nose.suite: DEBUG: Create suite for []
nose.suite: DEBUG: tests [] context None
nose.suite: DEBUG: wrap []
nose.suite: DEBUG: tests in 3081805388?
nose.loader: DEBUG: load from dir /home/chris/prog/nose_dev/matchcfgtest
nose.importer: DEBUG: Add path /home/chris/prog/nose_dev/matchcfgtest
nose.selector: DEBUG: wantFile
/home/chris/prog/nose_dev/matchcfgtest/bar.py? None
nose.selector: DEBUG: wantFile
/home/chris/prog/nose_dev/matchcfgtest/nose.cfg? False
nose.selector: DEBUG: wantFile
/home/chris/prog/nose_dev/matchcfgtest/test_bar.py? None
nose.selector: DEBUG: wantFile
/home/chris/prog/nose_dev/matchcfgtest/test_bar.pyc? False
nose.suite: DEBUG: Create suite for []
nose.suite: DEBUG: tests [] context None
nose.suite: DEBUG: wrap []
nose.suite: DEBUG: Context suite for [] (None) (3081805580)
nose.suite: DEBUG: wrapping
nose.suite: DEBUG: Context suite for [] (None) (3081805164)
nose.core: DEBUG: runTests called
nose.suite: DEBUG: suite 3081805164 setUp called, tests:
nose.suite: DEBUG: tests in 3081805164?
nose.suite: DEBUG: precache is []
nose.suite: DEBUG: precache is []
nose.suite: DEBUG: suite 3081805580 setUp called, tests:
nose.suite: DEBUG: tests in 3081805580?
nose.suite: DEBUG: suite 3081805580 has no tests
nose.suite: DEBUG: precache is []
nose.suite: DEBUG: context teardown
nose.suite: DEBUG: No reason to teardown (was_setup? False was_torndown? False)
nose.suite: DEBUG: context teardown
nose.suite: DEBUG: No reason to teardown (was_setup? False was_torndown? False)

----------------------------------------------------------------------
Ran 0 tests in 0.001s

OK
}}}

Version:
{{{
$ nosetests --version
nosetests version 0.10.3
}}}

Google Code Info:
Issue #: 213
Author: chris.bu...@gmail.com
Created On: 2008-10-30T16:28:14.000Z
Closed On: