From 5a424ccd53c4172c17487daf9c8211d103a11135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Ros=C3=A9n?= Date: Thu, 11 Mar 2021 11:40:50 +0100 Subject: [PATCH 1/2] Add pformat to config and use 3rd party printers if available --- snoop/configuration.py | 18 ++++++++++ snoop/pp_module.py | 3 +- .../sample_results/2.7/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../sample_results/3.4/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../sample_results/3.5/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../sample_results/3.6/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../sample_results/3.7/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../sample_results/3.8/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../sample_results/3.9/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../pypy2.7/pp_custom_pformat.txt | 36 +++++++++++++++++++ .../pypy3.5/pp_custom_pformat.txt | 36 +++++++++++++++++++ tests/samples/pp_custom_pformat.py | 17 +++++++++ 12 files changed, 360 insertions(+), 2 deletions(-) create mode 100644 tests/sample_results/2.7/pp_custom_pformat.txt create mode 100644 tests/sample_results/3.4/pp_custom_pformat.txt create mode 100644 tests/sample_results/3.5/pp_custom_pformat.txt create mode 100644 tests/sample_results/3.6/pp_custom_pformat.txt create mode 100644 tests/sample_results/3.7/pp_custom_pformat.txt create mode 100644 tests/sample_results/3.8/pp_custom_pformat.txt create mode 100644 tests/sample_results/3.9/pp_custom_pformat.txt create mode 100644 tests/sample_results/pypy2.7/pp_custom_pformat.txt create mode 100644 tests/sample_results/pypy3.5/pp_custom_pformat.txt create mode 100644 tests/samples/pp_custom_pformat.py diff --git a/snoop/configuration.py b/snoop/configuration.py index f2da409..df31ffd 100644 --- a/snoop/configuration.py +++ b/snoop/configuration.py @@ -1,5 +1,6 @@ import inspect import os +import pprint import sys import threading from io import open @@ -37,6 +38,7 @@ def install( watch_extras=(), replace_watch_extras=None, formatter_class=DefaultFormatter, + pformat=None, ): """ Configure output, enable or disable, and add names to builtins. Parameters: @@ -80,6 +82,7 @@ def install( watch_extras=watch_extras, replace_watch_extras=replace_watch_extras, formatter_class=formatter_class, + pformat=pformat, ) package.snoop.config = config package.pp.config = config @@ -104,6 +107,7 @@ def __init__( watch_extras=(), replace_watch_extras=None, formatter_class=DefaultFormatter, + pformat=None, ): if can_color: if color is None: @@ -115,6 +119,20 @@ def __init__( self.write = get_write_function(out, overwrite) self.formatter = formatter_class(prefix, columns, color) self.enabled = enabled + + if pformat is not None: + self.pformat = pformat + else: + try: + import prettyprinter + self.pformat = prettyprinter.pformat + except ImportError: + try: + import pprintpp + self.pformat = pprintpp.pformat + except ImportError: + self.pformat = pprint.pformat + self.pp = PP(self) class ConfiguredTracer(Tracer): diff --git a/snoop/pp_module.py b/snoop/pp_module.py index 0cc5b17..41d37f6 100644 --- a/snoop/pp_module.py +++ b/snoop/pp_module.py @@ -1,6 +1,5 @@ import ast import inspect -import pprint import traceback import warnings from copy import deepcopy @@ -68,7 +67,7 @@ def __init__(self, pp_object, args, deep): def write(self, source, value, depth=0): if depth == 0: - value_string = pprint.pformat(value) + value_string = self.config.pformat(value) else: try: value_string = repr(value) diff --git a/tests/sample_results/2.7/pp_custom_pformat.txt b/tests/sample_results/2.7/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/2.7/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/3.4/pp_custom_pformat.txt b/tests/sample_results/3.4/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/3.4/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/3.5/pp_custom_pformat.txt b/tests/sample_results/3.5/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/3.5/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/3.6/pp_custom_pformat.txt b/tests/sample_results/3.6/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/3.6/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/3.7/pp_custom_pformat.txt b/tests/sample_results/3.7/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/3.7/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/3.8/pp_custom_pformat.txt b/tests/sample_results/3.8/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/3.8/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/3.9/pp_custom_pformat.txt b/tests/sample_results/3.9/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/3.9/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/pypy2.7/pp_custom_pformat.txt b/tests/sample_results/pypy2.7/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/pypy2.7/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/sample_results/pypy3.5/pp_custom_pformat.txt b/tests/sample_results/pypy3.5/pp_custom_pformat.txt new file mode 100644 index 0000000..a0bccc9 --- /dev/null +++ b/tests/sample_results/pypy3.5/pp_custom_pformat.txt @@ -0,0 +1,36 @@ +12:34:56.78 LOG: +12:34:56.78 .... x + y = custom(30) +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test +12:34:56.78 LOG: +12:34:56.78 .... x + y = 30 +12:34:56.78 LOG: +12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 ............ x = 10 +12:34:56.78 ............ y = 20 +12:34:56.78 ........ x + y = 30 +12:34:56.78 ........ y = 20 +12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 LOG: +12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 +12:34:56.78 .......... x = 10 +12:34:56.78 .......... y = 20 +12:34:56.78 10 | z = 30 # custom pformat is not used here +12:34:56.78 .............. z = 30 +12:34:56.78 <<< Exit with block in test \ No newline at end of file diff --git a/tests/samples/pp_custom_pformat.py b/tests/samples/pp_custom_pformat.py new file mode 100644 index 0000000..127e8ef --- /dev/null +++ b/tests/samples/pp_custom_pformat.py @@ -0,0 +1,17 @@ + +def test(): + x = 10 + y = 20 + assert pp(pp(x + y) + y) == 50 + assert pp.deep(lambda: (x + y) + y) == 50 + pp([14, 15, 16]) + + with snoop: + z = 30 # custom pformat is not used here + +def main(): + snoop.install(pformat=lambda x: 'custom(' + repr(x) + ')') + test() + + snoop.install(pformat=None) + test() From 0c4f7ccfdac06d3d30f54ec9dcaccf45003888f1 Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Fri, 12 Mar 2021 21:29:54 +0200 Subject: [PATCH 2/2] Fix tests for 3.4 which can't pp --- .../sample_results/3.4/pp_custom_pformat.txt | 24 +++++++------------ tests/version_differences.txt | 5 ++++ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/tests/sample_results/3.4/pp_custom_pformat.txt b/tests/sample_results/3.4/pp_custom_pformat.txt index a0bccc9..24766c0 100644 --- a/tests/sample_results/3.4/pp_custom_pformat.txt +++ b/tests/sample_results/3.4/pp_custom_pformat.txt @@ -1,15 +1,11 @@ 12:34:56.78 LOG: -12:34:56.78 .... x + y = custom(30) +12:34:56.78 .... = custom(30) 12:34:56.78 LOG: -12:34:56.78 .... pp(x + y) + y = custom(50) +12:34:56.78 .... = custom(50) 12:34:56.78 LOG: -12:34:56.78 ............ x = 10 -12:34:56.78 ............ y = 20 -12:34:56.78 ........ x + y = 30 -12:34:56.78 ........ y = 20 -12:34:56.78 .... (x + y) + y = custom(50) +12:34:56.78 .... = custom(50) 12:34:56.78 LOG: -12:34:56.78 .... [14, 15, 16] = custom([14, 15, 16]) +12:34:56.78 .... = custom([14, 15, 16]) 12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 12:34:56.78 .......... x = 10 12:34:56.78 .......... y = 20 @@ -17,17 +13,13 @@ 12:34:56.78 .............. z = 30 12:34:56.78 <<< Exit with block in test 12:34:56.78 LOG: -12:34:56.78 .... x + y = 30 +12:34:56.78 .... = 30 12:34:56.78 LOG: -12:34:56.78 .... pp(x + y) + y = 50 +12:34:56.78 .... = 50 12:34:56.78 LOG: -12:34:56.78 ............ x = 10 -12:34:56.78 ............ y = 20 -12:34:56.78 ........ x + y = 30 -12:34:56.78 ........ y = 20 -12:34:56.78 .... (x + y) + y = 50 +12:34:56.78 .... = 50 12:34:56.78 LOG: -12:34:56.78 .... [14, 15, 16] = [14, 15, 16] +12:34:56.78 .... = [14, 15, 16] 12:34:56.78 >>> Enter with block in test in File "/path/to_file.py", line 9 12:34:56.78 .......... x = 10 12:34:56.78 .......... y = 20 diff --git a/tests/version_differences.txt b/tests/version_differences.txt index 05754c8..476864e 100644 --- a/tests/version_differences.txt +++ b/tests/version_differences.txt @@ -48,6 +48,11 @@ Differing versions: 3.8, 3.9 pypy3.5 +pp_custom_pformat +Differing versions: +2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2.7, pypy3.5 +3.4 + pp_exception Differing versions: 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2.7, pypy3.5