Merge master into features
This commit is contained in:
		
						commit
						9c03196e79
					
				| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Fix handling of ``collect_ignore`` via parent ``conftest.py``.
 | 
				
			||||||
| 
						 | 
					@ -5,6 +5,7 @@ requires = [
 | 
				
			||||||
  "setuptools-scm",
 | 
					  "setuptools-scm",
 | 
				
			||||||
  "wheel",
 | 
					  "wheel",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					build-backend = "setuptools.build_meta"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[tool.towncrier]
 | 
					[tool.towncrier]
 | 
				
			||||||
package = "pytest"
 | 
					package = "pytest"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -607,6 +607,7 @@ class Session(nodes.FSCollector):
 | 
				
			||||||
                yield y
 | 
					                yield y
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _collectfile(self, path, handle_dupes=True):
 | 
					    def _collectfile(self, path, handle_dupes=True):
 | 
				
			||||||
 | 
					        assert path.isfile()
 | 
				
			||||||
        ihook = self.gethookproxy(path)
 | 
					        ihook = self.gethookproxy(path)
 | 
				
			||||||
        if not self.isinitpath(path):
 | 
					        if not self.isinitpath(path):
 | 
				
			||||||
            if ihook.pytest_ignore_collect(path=path, config=self.config):
 | 
					            if ihook.pytest_ignore_collect(path=path, config=self.config):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -599,6 +599,7 @@ class Package(Module):
 | 
				
			||||||
        return proxy
 | 
					        return proxy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _collectfile(self, path, handle_dupes=True):
 | 
					    def _collectfile(self, path, handle_dupes=True):
 | 
				
			||||||
 | 
					        assert path.isfile()
 | 
				
			||||||
        ihook = self.gethookproxy(path)
 | 
					        ihook = self.gethookproxy(path)
 | 
				
			||||||
        if not self.isinitpath(path):
 | 
					        if not self.isinitpath(path):
 | 
				
			||||||
            if ihook.pytest_ignore_collect(path=path, config=self.config):
 | 
					            if ihook.pytest_ignore_collect(path=path, config=self.config):
 | 
				
			||||||
| 
						 | 
					@ -642,11 +643,12 @@ class Package(Module):
 | 
				
			||||||
            ):
 | 
					            ):
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if path.isdir() and path.join("__init__.py").check(file=1):
 | 
					            if path.isdir():
 | 
				
			||||||
                pkg_prefixes.add(path)
 | 
					                if path.join("__init__.py").check(file=1):
 | 
				
			||||||
 | 
					                    pkg_prefixes.add(path)
 | 
				
			||||||
            for x in self._collectfile(path):
 | 
					            else:
 | 
				
			||||||
                yield x
 | 
					                for x in self._collectfile(path):
 | 
				
			||||||
 | 
					                    yield x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _get_xunit_setup_teardown(holder, attr_name, param_obj=None):
 | 
					def _get_xunit_setup_teardown(holder, attr_name, param_obj=None):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1144,3 +1144,16 @@ def test_collect_symlink_out_of_tree(testdir):
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    assert result.ret == 0
 | 
					    assert result.ret == 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_collectignore_via_conftest(testdir, monkeypatch):
 | 
				
			||||||
 | 
					    """collect_ignore in parent conftest skips importing child (issue #4592)."""
 | 
				
			||||||
 | 
					    tests = testdir.mkpydir("tests")
 | 
				
			||||||
 | 
					    tests.ensure("conftest.py").write("collect_ignore = ['ignore_me']")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ignore_me = tests.mkdir("ignore_me")
 | 
				
			||||||
 | 
					    ignore_me.ensure("__init__.py")
 | 
				
			||||||
 | 
					    ignore_me.ensure("conftest.py").write("assert 0, 'should_not_be_called'")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    result = testdir.runpytest()
 | 
				
			||||||
 | 
					    assert result.ret == EXIT_NOTESTSCOLLECTED
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								tox.ini
								
								
								
								
							
							
						
						
									
										5
									
								
								tox.ini
								
								
								
								
							| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
[tox]
 | 
					[tox]
 | 
				
			||||||
minversion = 2.0
 | 
					isolated_build = True
 | 
				
			||||||
 | 
					minversion = 3.3
 | 
				
			||||||
distshare = {homedir}/.tox/distshare
 | 
					distshare = {homedir}/.tox/distshare
 | 
				
			||||||
# make sure to update environment list in travis.yml and appveyor.yml
 | 
					# make sure to update environment list in travis.yml and appveyor.yml
 | 
				
			||||||
envlist =
 | 
					envlist =
 | 
				
			||||||
| 
						 | 
					@ -166,7 +167,9 @@ commands =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[testenv:py37-freeze]
 | 
					[testenv:py37-freeze]
 | 
				
			||||||
changedir = testing/freeze
 | 
					changedir = testing/freeze
 | 
				
			||||||
 | 
					# Disable PEP 517 with pip, which does not work with PyInstaller currently.
 | 
				
			||||||
deps =
 | 
					deps =
 | 
				
			||||||
 | 
					    --no-use-pep517
 | 
				
			||||||
    pyinstaller
 | 
					    pyinstaller
 | 
				
			||||||
commands =
 | 
					commands =
 | 
				
			||||||
    {envpython} create_executable.py
 | 
					    {envpython} create_executable.py
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue