merge with default

This commit is contained in:
Anatoly Bubenkov
2014-10-07 01:06:15 +02:00
9 changed files with 245 additions and 170 deletions

View File

@@ -24,7 +24,7 @@ name_re = re.compile("^[a-zA-Z_]\w*$")
def pytest_addoption(parser):
parser.addini("norecursedirs", "directory patterns to avoid for recursion",
type="args", default=('.*', 'CVS', '_darcs', '{arch}', '*.egg'))
type="args", default=['.*', 'CVS', '_darcs', '{arch}', '*.egg'])
#parser.addini("dirpatterns",
# "patterns specifying possible locations of test files",
# type="linelist", default=["**/test_*.txt",

View File

@@ -56,6 +56,11 @@ def pytest_collection_modifyitems(items, config):
matchexpr = config.option.markexpr
if not keywordexpr and not matchexpr:
return
# pytest used to allow "-" for negating
# but today we just allow "-" at the beginning, use "not" instead
# we probably remove "-" alltogether soon
if keywordexpr.startswith("-"):
keywordexpr = "not " + keywordexpr[1:]
selectuntil = False
if keywordexpr[-1:] == ":":
selectuntil = True
@@ -122,7 +127,6 @@ def matchkeyword(colitem, keywordexpr):
Additionally, matches on names in the 'extra_keyword_matches' set of
any item, as well as names directly assigned to test functions.
"""
keywordexpr = keywordexpr.replace("-", "not ")
mapped_names = set()
# Add the names of the current item and any parent items

View File

@@ -124,11 +124,11 @@ def pytest_addoption(parser):
parser.addini("usefixtures", type="args", default=[],
help="list of default fixtures to be used with this project")
parser.addini("python_files", type="args",
default=('test_*.py', '*_test.py'),
default=['test_*.py', '*_test.py'],
help="glob-style file patterns for Python test module discovery")
parser.addini("python_classes", type="args", default=("Test",),
parser.addini("python_classes", type="args", default=["Test",],
help="prefixes for Python test class discovery")
parser.addini("python_functions", type="args", default=("test",),
parser.addini("python_functions", type="args", default=["test",],
help="prefixes for Python test function and method discovery")
def pytest_cmdline_main(config):