diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-06 17:42:53 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-06 17:43:26 -0500 |
commit | 7e85e782bc24fa487d77aff3356eaf04db764d21 (patch) | |
tree | d238edc7245c83ae73c2d3482507bf8423ad3710 /tests | |
parent | 7bd23c8ae4f219136332501ecd1767ed16ceb559 (diff) | |
download | python-coveragepy-git-7e85e782bc24fa487d77aff3356eaf04db764d21.tar.gz |
debug: pybehave is now an option on `coverage debug`
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cmdline.py | 12 | ||||
-rw-r--r-- | tests/test_debug.py | 9 |
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 7c5e1373..462cecee 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -272,7 +272,7 @@ class CmdLineTest(BaseCmdLineTest): """) @pytest.mark.parametrize("cmd, output", [ - ("debug", "What information would you like: config, data, sys, premain?"), + ("debug", "What information would you like: config, data, sys, premain, pybehave?"), ("debug foo", "Don't know what you mean by 'foo'"), ("debug sys config", "Only one topic at a time, please"), ]) @@ -292,6 +292,16 @@ class CmdLineTest(BaseCmdLineTest): assert "skip_covered:" in out assert "skip_empty:" in out + def test_debug_pybehave(self): + self.command_line("debug pybehave") + out = self.stdout() + assert " CPYTHON:" in out + assert " PYVERSION:" in out + assert " pep626:" in out + pyversion = next(l for l in out.splitlines() if " PYVERSION:" in l) + vtuple = eval(pyversion.partition(":")[-1]) # pylint: disable=eval-used + assert vtuple[:5] == sys.version_info + def test_debug_premain(self): self.command_line("debug premain") out = self.stdout() diff --git a/tests/test_debug.py b/tests/test_debug.py index 12315967..bade588e 100644 --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -6,6 +6,7 @@ import io import os import re +import sys import pytest @@ -197,6 +198,14 @@ class DebugTraceTest(CoverageTest): expected = "CTracer: unavailable" assert expected == tracer_line + def test_debug_pybehave(self): + out_text = self.f1_debug_output(["pybehave"]) + out_lines = out_text.splitlines() + assert 10 < len(out_lines) < 40 + pyversion = next(l for l in out_lines if " PYVERSION:" in l) + vtuple = eval(pyversion.partition(":")[-1]) # pylint: disable=eval-used + assert vtuple[:5] == sys.version_info + def f_one(*args, **kwargs): """First of the chain of functions for testing `short_stack`.""" |