Document collect_ignore and collect_ignore_glob in reference
This commit is contained in:
		
							parent
							
								
									2dc2a19db5
								
							
						
					
					
						commit
						1876a928d3
					
				| 
						 | 
					@ -797,6 +797,33 @@ Special Variables
 | 
				
			||||||
pytest treats some global variables in a special manner when defined in a test module.
 | 
					pytest treats some global variables in a special manner when defined in a test module.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					collect_ignore
 | 
				
			||||||
 | 
					~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Tutorial**: :ref:`customizing-test-collection`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Can be declared in *conftest.py files* to exclude test directories or modules.
 | 
				
			||||||
 | 
					Needs to be ``list[str]``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.. code-block:: python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  collect_ignore = ["setup.py"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					collect_ignore_glob
 | 
				
			||||||
 | 
					~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Tutorial**: :ref:`customizing-test-collection`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Can be declared in *conftest.py files* to exclude test directories or modules
 | 
				
			||||||
 | 
					with Unix shell-style wildcards. Needs to be ``list[str]`` where ``str`` can
 | 
				
			||||||
 | 
					contain glob patterns.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.. code-block:: python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  collect_ignore_glob = ["*_ignore.py"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pytest_plugins
 | 
					pytest_plugins
 | 
				
			||||||
~~~~~~~~~~~~~~
 | 
					~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue