Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change venusian callback to category 'pyramid' #35

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ jobs:
strategy:
matrix:
py:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy-2.7"
- "pypy3"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
os:
- "ubuntu-latest"
architecture:
Expand All @@ -43,14 +40,14 @@ jobs:
name: Validate coverage
steps:
- uses: actions/checkout@v2
- name: Setup python 3.9
- name: Setup python 3.13
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.13
architecture: x64

- run: pip install tox
- run: tox -e py27,py39,coverage
- run: tox -e py313,coverage
# docs:
# runs-on: ubuntu-latest
# name: Build the documentation
Expand Down
2 changes: 1 addition & 1 deletion pyramid_layout/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def callback(context, name, ob):
config = context.config.with_package(info.module)
config.add_layout(layout=ob, **settings)

info = venusian.attach(wrapped, callback, category='pyramid_layout')
info = venusian.attach(wrapped, callback, category='pyramid')

settings['_info'] = info.codeinfo # fbo "action_method"
return wrapped
2 changes: 1 addition & 1 deletion pyramid_layout/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def callback(context, name, ob):
config = context.config.with_package(info.module)
config.add_panel(panel=ob, **settings)

info = venusian.attach(wrapped, callback, category='pyramid_layout')
info = venusian.attach(wrapped, callback, category='pyramid')

if info.scope == 'class':
# if the decorator was attached to a method in a class, or
Expand Down
2 changes: 1 addition & 1 deletion pyramid_layout/tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_it(self, venusian):
self.assertEqual(decorator('wrapped'), 'wrapped')
info = venusian.attach.return_value
args, kwargs = venusian.attach.call_args
self.assertEqual(kwargs, {'category': 'pyramid_layout'})
self.assertEqual(kwargs, {'category': 'pyramid'})
wrapped, callback = args
self.assertEqual(wrapped, 'wrapped')
context = mock.Mock()
Expand Down
4 changes: 2 additions & 2 deletions pyramid_layout/tests/test_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_it(self, venusian):
decorator = fut(name='howdy')
self.assertEqual(decorator(panel), panel)
args, kw = venusian.attach.call_args
self.assertEqual(kw, {'category': 'pyramid_layout'})
self.assertEqual(kw, {'category': 'pyramid'})
venusian_wrapped, callback = args
self.assertEqual(venusian_wrapped, panel)
config_context = mock.Mock()
Expand All @@ -48,7 +48,7 @@ def test_it_w_method(self, venusian):
decorator = fut()
self.assertEqual(decorator(panel), panel)
args, kw = venusian.attach.call_args
self.assertEqual(kw, {'category': 'pyramid_layout'})
self.assertEqual(kw, {'category': 'pyramid'})
venusian_wrapped, callback = args
self.assertEqual(venusian_wrapped, panel)
config_context = mock.Mock()
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py27,py36,py37,py38,py39,pypy27,pypy3,coverage
py311,py312,py313,coverage

[testenv]
extras =
Expand Down