Always lstrip() keyword expression
This commit is contained in:
		
							parent
							
								
									56156bb119
								
							
						
					
					
						commit
						053c052190
					
				|  | @ -58,7 +58,7 @@ pytest_cmdline_main.tryfirst = True | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def pytest_collection_modifyitems(items, config): | def pytest_collection_modifyitems(items, config): | ||||||
|     keywordexpr = config.option.keyword |     keywordexpr = config.option.keyword.lstrip() | ||||||
|     matchexpr = config.option.markexpr |     matchexpr = config.option.markexpr | ||||||
|     if not keywordexpr and not matchexpr: |     if not keywordexpr and not matchexpr: | ||||||
|         return |         return | ||||||
|  |  | ||||||
|  | @ -670,6 +670,11 @@ class TestDurations: | ||||||
|             "*call*test_1*", |             "*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: | class TestDurationWithFixture: | ||||||
|     source = """ |     source = """ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue