Merge pull request #1623 from blueyed/ignore-hidden-files-in-test_pytest_collect_file
Ignore hidden files (.testmondata) in test_pytest_collect_file
This commit is contained in:
		
						commit
						2f9d5c2586
					
				| 
						 | 
					@ -150,6 +150,8 @@ class TestCollectPluginHookRelay:
 | 
				
			||||||
        wascalled = []
 | 
					        wascalled = []
 | 
				
			||||||
        class Plugin:
 | 
					        class Plugin:
 | 
				
			||||||
            def pytest_collect_file(self, path, parent):
 | 
					            def pytest_collect_file(self, path, parent):
 | 
				
			||||||
 | 
					                if not path.basename.startswith("."):
 | 
				
			||||||
 | 
					                    # Ignore hidden files, e.g. .testmondata.
 | 
				
			||||||
                    wascalled.append(path)
 | 
					                    wascalled.append(path)
 | 
				
			||||||
        testdir.makefile(".abc", "xyz")
 | 
					        testdir.makefile(".abc", "xyz")
 | 
				
			||||||
        pytest.main([testdir.tmpdir], plugins=[Plugin()])
 | 
					        pytest.main([testdir.tmpdir], plugins=[Plugin()])
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue