Skip to content

Commit

Permalink
Test and fix 3.12 and 3.13, stop testing before 3.8 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmojaki authored Oct 6, 2024
1 parent 98102bd commit 3ba2c39
Show file tree
Hide file tree
Showing 313 changed files with 1,814 additions and 6,457 deletions.
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

0 comments on commit 3ba2c39

Please sign in to comment.