summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmdline.py12
-rw-r--r--tests/test_debug.py9
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`."""