Add a test for a previously fixed reloading bug

This commit is contained in:
Kodi Arfer 2019-06-28 13:41:14 -04:00
parent e436d9dd4d
commit eb265181bf
2 changed files with 13 additions and 0 deletions

View File

@ -234,6 +234,18 @@ def test_reload():
unlink(source)
def test_reload_reexecute(capsys):
"""A module is re-executed when it's reloaded, even if it's
unchanged.
https://github.com/hylang/hy/issues/712"""
import tests.resources.hello_world
assert capsys.readouterr().out == 'hello world\n'
assert capsys.readouterr().out == ''
reload(tests.resources.hello_world)
assert capsys.readouterr().out == 'hello world\n'
def test_circular():
"""Test circular imports by creating a temporary file/module that calls a
function that imports itself."""

View File

@ -0,0 +1 @@
(print "hello world")