test_locals.py 366 Bytes
Newer Older
dugupeiwen's avatar
dugupeiwen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from numba import float32
from numba.core import compiler
import unittest

def foo():
    x = 123
    return x


class TestLocals(unittest.TestCase):

    def test_seed_types(self):
        cres = compiler.compile_isolated(foo, (), locals={'x': float32})
        self.assertEqual(cres.signature.return_type, float32)


if __name__ == '__main__':
    unittest.main()