Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 11, 2024
1 parent 1fc04ca commit 4d0cbe6
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 20 deletions.
2 changes: 0 additions & 2 deletions panel/io/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ async def setup_autoreload_watcher(stop_event=None):
def watch(filename):
"""
Add a file to the watch list.
All imported modules are watched by default.
"""
_watched_files.add(filename)

Expand Down
5 changes: 0 additions & 5 deletions panel/tests/ui/io/app.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"source": [
"import panel as pn\n",
"\n",
"if 'num' in pn.state.cache:\n",
" pn.state.cache['num'] += 1\n",
"else:\n",
" pn.state.cache['num'] = 0\n",
"\n",
"pn.pane.Markdown(f\"{pn.state.cache['num']}\", css_classes=['counter']).servable()"
]
}
Expand Down
5 changes: 0 additions & 5 deletions panel/tests/ui/io/app.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
```{pyodide}
import panel as pn
if 'num' in pn.state.cache:
pn.state.cache['num'] += 1
else:
pn.state.cache['num'] = 0
pn.pane.Markdown(f"{pn.state.cache['num']}", css_classes=['counter']).servable()
```
5 changes: 0 additions & 5 deletions panel/tests/ui/io/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

pn.config.raw_css = ['.bk-Row { background-color: purple; }']

if 'num' in pn.state.cache:
pn.state.cache['num'] += 1
else:
pn.state.cache['num'] = 0

md = pn.pane.Markdown(f"{pn.state.cache['num']}", css_classes=['counter'])

button = pn.widgets.Button(name='Click')
Expand Down
5 changes: 2 additions & 3 deletions panel/tests/ui/io/test_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@
str(CURPATH / 'app.ipynb'),
])
def test_reload_app_on_touch(page, autoreload, app):
if 'num' in state.cache:
del state.cache['num']

path = pathlib.Path(app)

autoreload(path)

state.cache['num'] = 0
serve_component(page, path)

expect(page.locator('.counter')).to_have_text('0')

state.cache['num'] = 1
path.touch()

expect(page.locator('.counter')).to_have_text('1')
Expand Down

0 comments on commit 4d0cbe6

Please sign in to comment.