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

chore: make event_name mandatory in Framework #1538

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions ops/_private/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def __init__(
self._charm_dir,
self._meta,
self._model,
'',
juju_debug_at=self._juju_context.debug_at,
# Harness tests will often have defer() usage without 'purging' the
# deferred handler with reemit(), but still expect the next emit()
Expand Down
2 changes: 1 addition & 1 deletion ops/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def __init__(
charm_dir: Union[str, pathlib.Path],
meta: 'charm.CharmMeta',
model: 'Model',
event_name: Optional[str] = None,
event_name: str,
juju_debug_at: Optional[Set[str]] = None,
skip_duplicate_events: bool = True,
):
Expand Down
2 changes: 2 additions & 0 deletions test/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def create_framework(
charm_dir,
meta=model._cache._meta if model else ops.CharmMeta(),
model=model, # type: ignore
event_name='',
juju_debug_at=_JujuContext.from_dict(os.environ).debug_at,
)
request.addfinalizer(framework.close)
Expand All @@ -94,6 +95,7 @@ def test_deprecated_init(self, caplog: pytest.LogCaptureFixture):
None, # type: ignore
None, # type: ignore
None, # type: ignore
'',
juju_debug_at=set(),
)
assert 'WARNING:ops.framework:deprecated: Framework now takes a Storage not a path' in [
Expand Down
1 change: 1 addition & 0 deletions test/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class TestCharmEvents(ops.CharmEvents):
tmpdir,
meta,
model,
'foo_event',
juju_debug_at=_JujuContext.from_dict(os.environ).debug_at,
)

Expand Down
1 change: 1 addition & 0 deletions test/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def create_framework(
None, # type: ignore
None, # type: ignore
None, # type: ignore
'',
juju_debug_at=set(),
)

Expand Down
Loading