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
Cannot generate testcase with import statement e.g. numpy
#35
Comments
But, when changing the way to import as following, it can work. from numpy import array
def gen_array(value):
return array(value) So, how can I make pynguin to work when using the normal |
Sorry for the late reply. I've only found the time now to investigate on this issue. The reason why your first example fails while your second one runs successfully lies in how the Python import system (and our module analysis in Pynguin) work: when you do Our module analysis now takes all imported code and analyses it. In the first case, it attempts to analyse a huge amount of NumPy code (everything transitively included by The latter case works fine, as you've already mentioned. The former case, however, fails when Pynguin tries to retrieve the function's signature data using Python's So, what can you do about this? Unfortunately, not too much. We need to carefully consider, whether we can just catch the particular exception, without breaking any other functionality regarding our module analysis. This might only be addressed in some future version of Pynguin. For now, the only thing you could do is using the |
Similar issue for pandas:
The traceback I get is
|
- Fix an issue with type-information retrieval (see GitHub issue #35)
I've just released Pynguin 0.33.0, which should fix the issue. I assume that this is only a partial fault of Pynguin—we are querying |
@stephanlukasczyk in pynguin 0.34.0 i still get
for:
also get
|
Do you have a full MRE for me, @tooptoop4 , please? That is, source file, required dependencies plus their versions, Pynguin command line, etc. Otherwise, it's hard to debug things and come up with a fix. |
I try to run pynguin to generate the test case for this example module (
numpy_example
) containing the following snippet.but i got an error as
ValueError: no signature found for builtin <built-in function where>
This is the full stack trace.
The text was updated successfully, but these errors were encountered: