diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 9e4d51bd2..113ff96c1 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -1090,8 +1090,7 @@ class TerminalReporter: self, which_reports: str, sep_title: str, needed_opt: Optional[str] = None, style = None ) -> None: if style is None: - style == self.config.option.tbstyle - + style = self.config.option.tbstyle if style != "no": if not needed_opt or self.hasopt(needed_opt): reports: List[BaseReport] = self.getreports(which_reports) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 170f1efcf..60c49c644 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2949,7 +2949,7 @@ def test_xfail_tb_line(pytester: Pytester) -> None: assert a == b """ ) - result = pytester.runpytest("-rx", "--tb=line") + result = pytester.runpytest("-rx", "--xfail-tb=line") result.stdout.fnmatch_lines( [ "*= XFAILURES =*",