Merge master into features
This commit is contained in:
		
						commit
						aca1723d45
					
				| 
						 | 
					@ -527,6 +527,8 @@ class Testdir:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    __test__ = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CLOSE_STDIN = object
 | 
					    CLOSE_STDIN = object
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class TimeoutExpired(Exception):
 | 
					    class TimeoutExpired(Exception):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,6 +16,7 @@ from _pytest.pytester import HookRecorder
 | 
				
			||||||
from _pytest.pytester import LineMatcher
 | 
					from _pytest.pytester import LineMatcher
 | 
				
			||||||
from _pytest.pytester import SysModulesSnapshot
 | 
					from _pytest.pytester import SysModulesSnapshot
 | 
				
			||||||
from _pytest.pytester import SysPathsSnapshot
 | 
					from _pytest.pytester import SysPathsSnapshot
 | 
				
			||||||
 | 
					from _pytest.pytester import Testdir
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_make_hook_recorder(testdir) -> None:
 | 
					def test_make_hook_recorder(testdir) -> None:
 | 
				
			||||||
| 
						 | 
					@ -273,7 +274,8 @@ def test_assert_outcomes_after_pytest_error(testdir) -> None:
 | 
				
			||||||
        result.assert_outcomes(passed=0)
 | 
					        result.assert_outcomes(passed=0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_cwd_snapshot(tmpdir) -> None:
 | 
					def test_cwd_snapshot(testdir: Testdir) -> None:
 | 
				
			||||||
 | 
					    tmpdir = testdir.tmpdir
 | 
				
			||||||
    foo = tmpdir.ensure("foo", dir=1)
 | 
					    foo = tmpdir.ensure("foo", dir=1)
 | 
				
			||||||
    bar = tmpdir.ensure("bar", dir=1)
 | 
					    bar = tmpdir.ensure("bar", dir=1)
 | 
				
			||||||
    foo.chdir()
 | 
					    foo.chdir()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -557,7 +557,7 @@ def test_outcomeexception_passes_except_Exception() -> None:
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            raise outcomes.OutcomeException("test")
 | 
					            raise outcomes.OutcomeException("test")
 | 
				
			||||||
        except Exception:
 | 
					        except Exception:
 | 
				
			||||||
            pass
 | 
					            raise NotImplementedError()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_pytest_exit() -> None:
 | 
					def test_pytest_exit() -> None:
 | 
				
			||||||
| 
						 | 
					@ -740,8 +740,9 @@ def test_importorskip(monkeypatch) -> None:
 | 
				
			||||||
        mod2 = pytest.importorskip("hello123", minversion="1.3")
 | 
					        mod2 = pytest.importorskip("hello123", minversion="1.3")
 | 
				
			||||||
        assert mod2 == mod
 | 
					        assert mod2 == mod
 | 
				
			||||||
    except Skipped:
 | 
					    except Skipped:
 | 
				
			||||||
        print(_pytest._code.ExceptionInfo.from_current())
 | 
					        raise NotImplementedError(
 | 
				
			||||||
        pytest.fail("spurious skip")
 | 
					            "spurious skip: {}".format(_pytest._code.ExceptionInfo.from_current())
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_importorskip_imports_last_module_part() -> None:
 | 
					def test_importorskip_imports_last_module_part() -> None:
 | 
				
			||||||
| 
						 | 
					@ -759,8 +760,9 @@ def test_importorskip_dev_module(monkeypatch) -> None:
 | 
				
			||||||
        with pytest.raises(Skipped):
 | 
					        with pytest.raises(Skipped):
 | 
				
			||||||
            pytest.importorskip("mockmodule1", minversion="0.14.0")
 | 
					            pytest.importorskip("mockmodule1", minversion="0.14.0")
 | 
				
			||||||
    except Skipped:
 | 
					    except Skipped:
 | 
				
			||||||
        print(_pytest._code.ExceptionInfo.from_current())
 | 
					        raise NotImplementedError(
 | 
				
			||||||
        pytest.fail("spurious skip")
 | 
					            "spurious skip: {}".format(_pytest._code.ExceptionInfo.from_current())
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_importorskip_module_level(testdir) -> None:
 | 
					def test_importorskip_module_level(testdir) -> None:
 | 
				
			||||||
| 
						 | 
					@ -1030,7 +1032,7 @@ def test_outcome_exception_bad_msg() -> None:
 | 
				
			||||||
    """Check that OutcomeExceptions validate their input to prevent confusing errors (#5578)"""
 | 
					    """Check that OutcomeExceptions validate their input to prevent confusing errors (#5578)"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def func() -> None:
 | 
					    def func() -> None:
 | 
				
			||||||
        pass
 | 
					        raise NotImplementedError()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    expected = (
 | 
					    expected = (
 | 
				
			||||||
        "OutcomeException expected string as 'msg' parameter, got 'function' instead.\n"
 | 
					        "OutcomeException expected string as 'msg' parameter, got 'function' instead.\n"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue