Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
austin3dickey committed Feb 18, 2025
1 parent 4448754 commit 84fe67d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def shell(kernel) -> Iterable[PositronShell]:
yield shell

# Ensure a clean namespace
# TODO: clean hidden vars here?
new_user_ns_keys = set(shell.user_ns.keys()) - user_ns_keys
for key in new_user_ns_keys:
del shell.user_ns[key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def test_plotly_show_sends_events(
assert params["title"] == ""
assert params["is_plot"]
assert params["height"] == 0
# TODO: go through this interactively and ensure the plot doesn't appear in __


def test_is_not_plot_url_events(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ def _get_filtered_vars(self, variables: Mapping[str, Any] | None = None) -> dict
"""
if variables is None:
variables = self._get_user_ns()
# This path only runs during initialization so we don't care about the values of the
# hidden variables
hidden = self.kernel.shell.user_ns_hidden or {}
return {key: value for key, value in variables.items() if key not in hidden}

return {key: value for key, value in variables.items() if not self._is_hidden(key, value)}

Expand Down

0 comments on commit 84fe67d

Please sign in to comment.