Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', 3.11-dev, 'pypy-2.7', 'pypy-3.6']
python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: run tests
run: |
pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions snoop/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def opname(self):
def is_yield_value(self):
for i in range(self.frame.f_lasti, -1, -1):
opname = self.opname_at(i)
if opname not in ('RESUME', 'CACHE'):
if opname not in ('RESUME', 'CACHE', 'POP_TOP', 'PUSH_NULL'):
return opname == 'YIELD_VALUE'


Expand Down Expand Up @@ -303,15 +303,15 @@ def format_return(self, event):
if event.frame_info.had_exception:
return [u'{c.red}??? Call either returned None or ended by exception{c.reset}'
.format(c=self.c)]
elif opname not in ('RETURN_VALUE', 'YIELD_VALUE'):
elif opname not in ('RETURN_VALUE', 'YIELD_VALUE', 'RETURN_CONST'):
return [u'{c.red}!!! Call ended by exception{c.reset}'.format(c=self.c)]

value = self.highlighted(my_cheap_repr(arg))
if event.comprehension_type:
prefix = plain_prefix = u'Result: '
else:
plain_prefix = u'<<< {description} value from {func}: '.format(
description='Yield' if opname == 'YIELD_VALUE' else 'Return',
description='Yield' if opname in ('YIELD_VALUE', 'RESUME') else 'Return',
func=event.code_qualname(),
)
prefix = u'{c.green}{}{c.reset}'.format(
Expand Down
104 changes: 0 additions & 104 deletions tests/sample_results/2.7/color.txt

This file was deleted.

95 changes: 0 additions & 95 deletions tests/sample_results/2.7/comprehensions.txt

This file was deleted.

9 changes: 0 additions & 9 deletions tests/sample_results/2.7/decorator_exception.txt

This file was deleted.

51 changes: 0 additions & 51 deletions tests/sample_results/2.7/pp_custom_pformat.txt

This file was deleted.

Loading
Loading