Merge pull request #5506 from asottile/fix_no_terminal
Fix crash when discovery fails while using `-p no:terminal`
This commit is contained in:
		
						commit
						f7bfbb557e
					
				| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
Fix crash when discovery fails while using ``-p no:terminal``.
 | 
			
		||||
| 
						 | 
				
			
			@ -323,7 +323,7 @@ class Collector(Node):
 | 
			
		|||
 | 
			
		||||
        # Respect explicit tbstyle option, but default to "short"
 | 
			
		||||
        # (None._repr_failure_py defaults to "long" without "fulltrace" option).
 | 
			
		||||
        tbstyle = self.config.getoption("tbstyle")
 | 
			
		||||
        tbstyle = self.config.getoption("tbstyle", "auto")
 | 
			
		||||
        if tbstyle == "auto":
 | 
			
		||||
            tbstyle = "short"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -741,7 +741,7 @@ def test_config_in_subdirectory_colon_command_line_issue2148(testdir):
 | 
			
		|||
        **{
 | 
			
		||||
            "conftest": conftest_source,
 | 
			
		||||
            "subdir/conftest": conftest_source,
 | 
			
		||||
            "subdir/test_foo": """
 | 
			
		||||
            "subdir/test_foo": """\
 | 
			
		||||
            def test_foo(pytestconfig):
 | 
			
		||||
                assert pytestconfig.getini('foo') == 'subdir'
 | 
			
		||||
            """,
 | 
			
		||||
| 
						 | 
				
			
			@ -777,6 +777,12 @@ def test_notify_exception(testdir, capfd):
 | 
			
		|||
    assert "ValueError" in err
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_no_terminal_discovery_error(testdir):
 | 
			
		||||
    testdir.makepyfile("raise TypeError('oops!')")
 | 
			
		||||
    result = testdir.runpytest("-p", "no:terminal", "--collect-only")
 | 
			
		||||
    assert result.ret == ExitCode.INTERRUPTED
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_load_initial_conftest_last_ordering(testdir, _config_for_test):
 | 
			
		||||
    pm = _config_for_test.pluginmanager
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue