After looking through the source of nose, specifically the selector.py file, if you look at what's happening,
https://github.com/nose-devs/nose/blob/master/nose/selector.py#L129
When checking if we wantFile
, self.matches
is called, which then does a regex
search against the match
, which is what you would have passed in as testMatch
.
The problem occurs when you then check later down (and, throughout that file),
https://github.com/nose-devs/nose/blob/master/nose/selector.py#L152
It runs the very same type of checks again, against wantFunction
.
This means, if you've got a different structure for your package, your container pyfile, and your actual test class / function, you'll have to create a crazy complicated regex to match that at every stage.
For me, when I learned this, I chose to prefix my package, container and test functions with a common bit, i.e.
setests
├── __init__.py
├── setest_area1.py
└──── def setest_someblock(): ...
And then my nose
command works like,
nose --testMatch="setest"
This then filters the way I expect it to work.