File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,19 @@ def test_function_parser(code):
190190 p .visit (ast .parse (code ))
191191 assert 'round' in p .out
192192
193+ def test_check_function_parser_mappings_1 ():
194+ code = "import numpy as np\n np.random.randint(1, 7)"
195+ s = setup_state (code , code )
196+ s .check_function ('numpy.random.randint' )
197+
198+ # Because the mappings are only found for the substate that is zoomed in on,
199+ # The `import numpy as np` part is not found, because it's outside of the for loop.
200+ # This should be fixed!!!
201+ @pytest .mark .xfail
202+ def test_check_function_parser_mappings_2 ():
203+ code = "import numpy as np\n for x in range(0): np.random.randint(1, 7)"
204+ s = setup_state (code , code )
205+ s .check_for_loop ().check_body ().check_function ('numpy.random.randint' )
193206
194207# Incorrect usage -------------------------------------------------------------
195208
You can’t perform that action at this time.
0 commit comments