Open khangtran2020 opened 4 days ago
Could you provide me a minimal working example, please, that exhibits the behaviour? I have zero experience with Flask, thus need something to work with. Please also specify versions of Python, Pynguin, and dependencies, as well as everything else that would be needed to reproduce the issue.
Thank you for your response. I clone the flask repo here: https://github.com/pallets/flask
Then I run:
pynguin --project-path ./src/flask --output-path ../test --module-name cli
And get this error:
ImportError: attempted relative import with no known parent package
AFAIK, Pynguin adds the directory specified with 'project-path' to sys.path. So you have to use the following command for your example:
pynguin --project-path ./src/ --output-path ../test --module-name flask.cli
Did @Wooza 's suggestion resolve the issue, @khangtran2020 ?
I want to test flask package with pynguin, however pynguin cannot deal with relative imports (i.e., cannot import relative modules of flask). Can you give me some advice on how to solve this problem?