MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_load_source

Method test_load_source

dali/test/python/autograph/pyct/test_loader.py:101–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

99 self.assertAstMatches(node, temp_output.read())
100
101 def test_load_source(self):
102 test_source = textwrap.dedent("""
103 # coding=utf-8
104 def f(a):
105 '日本語 Δθₜ ← Δθₜ₋₁ + ∇Q(sₜ, aₜ)(rₜ + γₜ₊₁ max Q(⋅))'
106 return a + 1
107 """)
108 module, _ = loader.load_source(test_source, delete_on_exit=True)
109 self.assertEqual(module.f(1), 2)
110 self.assertEqual(module.f.__doc__, "日本語 Δθₜ ← Δθₜ₋₁ + ∇Q(sₜ, aₜ)(rₜ + γₜ₊₁ max Q(⋅))")
111
112 def test_cleanup(self):
113 test_source = textwrap.dedent("")

Callers

nothing calls this directly

Calls 1

fMethod · 0.45

Tested by

no test coverage detected