Add more tests and docs
This commit is contained in:
		
							parent
							
								
									8a022c0ce3
								
							
						
					
					
						commit
						320625527a
					
				| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Version information as defined by `PEP 440 <https://www.python.org/dev/peps/pep-0440/#version-specifiers>`_ may now be included when providing plugins to the ``required_plugins`` configuration option.
 | 
				
			||||||
| 
						 | 
					@ -1562,12 +1562,14 @@ passed multiple times. The expected format is ``name=value``. For example::
 | 
				
			||||||
.. confval:: required_plugins
 | 
					.. confval:: required_plugins
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   A space separated list of plugins that must be present for pytest to run.
 | 
					   A space separated list of plugins that must be present for pytest to run.
 | 
				
			||||||
 | 
					   Plugins can be listed with or without version specifiers directly following
 | 
				
			||||||
 | 
					   their name. Whitespace between different version specifiers is not allowed.
 | 
				
			||||||
   If any one of the plugins is not found, emit an error.
 | 
					   If any one of the plugins is not found, emit an error.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   .. code-block:: ini
 | 
					   .. code-block:: ini
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       [pytest]
 | 
					       [pytest]
 | 
				
			||||||
       required_plugins = pytest-html pytest-xdist
 | 
					       required_plugins = pytest-django>=3.0.0,<4.0.0 pytest-html pytest-xdist>=1.0.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. confval:: testpaths
 | 
					.. confval:: testpaths
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1101,7 +1101,7 @@ class Config:
 | 
				
			||||||
        plugin_info = self.pluginmanager.list_plugin_distinfo()
 | 
					        plugin_info = self.pluginmanager.list_plugin_distinfo()
 | 
				
			||||||
        plugin_dist_info = {dist.project_name: dist.version for _, dist in plugin_info}
 | 
					        plugin_dist_info = {dist.project_name: dist.version for _, dist in plugin_info}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        missing_plugins = ["a"]
 | 
					        missing_plugins = []
 | 
				
			||||||
        for required_plugin in required_plugins:
 | 
					        for required_plugin in required_plugins:
 | 
				
			||||||
            spec = None
 | 
					            spec = None
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -265,6 +265,13 @@ class TestParseIni:
 | 
				
			||||||
            (
 | 
					            (
 | 
				
			||||||
                """
 | 
					                """
 | 
				
			||||||
          [pytest]
 | 
					          [pytest]
 | 
				
			||||||
 | 
					          required_plugins = pytest-xdist>1.0.0,<2.0.0
 | 
				
			||||||
 | 
					          """,
 | 
				
			||||||
 | 
					                "",
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            (
 | 
				
			||||||
 | 
					                """
 | 
				
			||||||
 | 
					          [pytest]
 | 
				
			||||||
          required_plugins = pytest-xdist~=1.32.0 pytest-xdist==1.32.0 pytest-xdist!=0.0.1 pytest-xdist<=99.99.0
 | 
					          required_plugins = pytest-xdist~=1.32.0 pytest-xdist==1.32.0 pytest-xdist!=0.0.1 pytest-xdist<=99.99.0
 | 
				
			||||||
            pytest-xdist>=1.32.0 pytest-xdist<9.9.9 pytest-xdist>1.30.0 pytest-xdist===1.32.0
 | 
					            pytest-xdist>=1.32.0 pytest-xdist<9.9.9 pytest-xdist>1.30.0 pytest-xdist===1.32.0
 | 
				
			||||||
          """,
 | 
					          """,
 | 
				
			||||||
| 
						 | 
					@ -280,16 +287,9 @@ class TestParseIni:
 | 
				
			||||||
            (
 | 
					            (
 | 
				
			||||||
                """
 | 
					                """
 | 
				
			||||||
          [pytest]
 | 
					          [pytest]
 | 
				
			||||||
          required_plugins = pytest-xdist==aegsrgrsgs
 | 
					          required_plugins = pytest-xdist==aegsrgrsgs pytest-xdist==-1 pytest-xdist>2.1.1,>3.0.0
 | 
				
			||||||
          """,
 | 
					          """,
 | 
				
			||||||
                "Missing required plugins: pytest-xdist==aegsrgrsgs",
 | 
					                "Missing required plugins: pytest-xdist==-1, pytest-xdist==aegsrgrsgs, pytest-xdist>2.1.1,>3.0.0",
 | 
				
			||||||
            ),
 | 
					 | 
				
			||||||
            (
 | 
					 | 
				
			||||||
                """
 | 
					 | 
				
			||||||
          [pytest]
 | 
					 | 
				
			||||||
          required_plugins = pytest-xdist==-1
 | 
					 | 
				
			||||||
          """,
 | 
					 | 
				
			||||||
                "Missing required plugins: pytest-xdist==-1",
 | 
					 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            (
 | 
					            (
 | 
				
			||||||
                """
 | 
					                """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue