File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -294,3 +294,23 @@ def test_cache_across_reloads_with_class():
294294 Path ("main.py" ).write_text ("from reactivity.hmr import cache_across_reloads\n \n @cache_across_reloads\n def f():\n class _:\n print(a)\n \n f()\n " )
295295 load (ReactiveModule (Path ("main.py" ), {"a" : 1 }, "main" ))
296296 assert stdout .delta == "1\n "
297+
298+
299+ @pytest .mark .xfail (strict = True )
300+ def test_cache_across_reloads_source ():
301+ with environment ():
302+ Path ("main.py" ).write_text (
303+ dedent (
304+ """
305+
306+ from inspect import getsource
307+ from reactivity.hmr.utils import cache_across_reloads
308+
309+ def f(): pass
310+
311+ assert getsource(f) == getsource(cache_across_reloads(f))
312+
313+ """
314+ )
315+ )
316+ load (ReactiveModule (Path ("main.py" ), {}, "main" ))
You can’t perform that action at this time.
0 commit comments