From 0f58fc881b795478d3f93f8f2bbd6b73a11b4c57 Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Thu, 22 Feb 2018 19:26:46 +0100 Subject: [PATCH] Add pdb test with disabled logging plugin Implement the test from #3210, which was not merged yet, because the PR was abandoned in favor or #3234. --- testing/test_pdb.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/testing/test_pdb.py b/testing/test_pdb.py index a36ada05b23..445cafcc5f9 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -205,6 +205,24 @@ def test_1(): assert "1 failed" in rest self.flush(child) + def test_pdb_print_captured_logs_nologging(self, testdir): + p1 = testdir.makepyfile(""" + def test_1(): + import logging + logging.warn("get " + "rekt") + assert False + """) + child = testdir.spawn_pytest("--show-capture=all --pdb " + "-p no:logging %s" % p1) + child.expect("get rekt") + output = child.before.decode("utf8") + assert "captured log" not in output + child.expect("(Pdb)") + child.sendeof() + rest = child.read().decode("utf8") + assert "1 failed" in rest + self.flush(child) + def test_pdb_interaction_exception(self, testdir): p1 = testdir.makepyfile(""" import pytest