Skip to content

Commit

Permalink
Add pdb test with disabled logging plugin
Browse files Browse the repository at this point in the history
Implement the test from #3210, which was not merged yet, because the PR was
abandoned in favor or #3234.
  • Loading branch information
twmr committed Feb 22, 2018
1 parent 54e63b7 commit 0f58fc8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions testing/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f58fc8

Please sign in to comment.