Always lstrip() keyword expression

This commit is contained in:
Tyler Goodlet 2016-04-01 01:20:22 -04:00
parent 56156bb119
commit 053c052190
2 changed files with 6 additions and 1 deletions

View File

@ -58,7 +58,7 @@ pytest_cmdline_main.tryfirst = True
def pytest_collection_modifyitems(items, config):
keywordexpr = config.option.keyword
keywordexpr = config.option.keyword.lstrip()
matchexpr = config.option.markexpr
if not keywordexpr and not matchexpr:
return

View File

@ -670,6 +670,11 @@ class TestDurations:
"*call*test_1*",
])
def test_with_not(self, testdir):
testdir.makepyfile(self.source)
result = testdir.runpytest("-k not 1")
assert result.ret == 0
class TestDurationWithFixture:
source = """