Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_function inside for loop can't find aliases outside #353

Open
filipsch opened this issue Sep 14, 2018 · 0 comments
Open

check_function inside for loop can't find aliases outside #353

filipsch opened this issue Sep 14, 2018 · 0 comments
Labels

Comments

@filipsch
Copy link
Contributor

filipsch commented Sep 14, 2018

The following works fine:

# solution
import numpy as np
np.random.randint(1, 7)

# sct
Ex().check_function('numpy.random.randint')

The following does not:

# solution
import numpy as np
for x in range(0):
    np.random.randint(1, 7)

# sct
Ex().check_for_loop().check_body().check_function('numpy.random.randint')

This is because the mappings of aliases onto their modules are figured out on a per-state basis (instead of once, on the root).

There's a failing test (with the xfail mark) here.

This is a pretty big bug!!!

filipsch pushed a commit that referenced this issue Sep 14, 2018
@filipsch filipsch added the bug label Sep 14, 2018
filipsch pushed a commit that referenced this issue Sep 21, 2018
filipsch pushed a commit that referenced this issue Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant