Skip to content

Commit 41d1dbb

Browse files
andrewjcgfacebook-github-bot
authored andcommitted
Fix auto-reload test in OSS (#449)
Summary: Pull Request resolved: #449 The Python interpreter may not always generate bytecode. Reviewed By: shayne-fletcher Differential Revision: D77686787 fbshipit-source-id: 22cb3be5c375ba1cf6ca2707ce343775e701836a
1 parent a007830 commit 41d1dbb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/tests/code_sync/test_auto_reload.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def importable_workspace() -> Generator[Path, Any, Any]:
4242

4343

4444
class TestAutoReloader(unittest.TestCase):
45-
@pytest.mark.oss_skip # pyre-ignore[56] TODO T229709067
4645
def test_source_change(self):
4746
with importable_workspace() as workspace:
4847
reloader = AutoReloader(workspace)
@@ -56,7 +55,11 @@ def test_source_change(self):
5655
self.assertEqual(test_module.foo, 1)
5756

5857
write_text(filename, "foo = 2\nbar = 4\n")
59-
os.remove(importlib.util.cache_from_source(filename)) # force recompile
58+
try:
59+
# force recompile
60+
os.remove(importlib.util.cache_from_source(filename))
61+
except FileNotFoundError:
62+
pass # python may not always implicitly generate bytecode
6063

6164
self.assertEqual(
6265
reloader.reload_changes(),

0 commit comments

Comments
 (0)