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
Generating weird folders during test gen #6
Comments
Hi @xnuinside , First of all, thank you for your interest in Pynguin. We've noticed this behaviour, when generating tests for a module that contains some code that can create files or directories. Unfortunately, I don't know about the code of your example module—is there a chance to have access to it to play around with it, if needed? Is this the case for your module under test that it contains (or includes) some code that can create files and directories? Anyway, what we recommend is to run Pynguin in some isolated environment, e.g., a Docker container. This not only applies to this special case but is a general recommendation because Pynguin, while executing the generated tests, will execute basically arbitrary code. Assume, you generate tests for a module that contains code to remove all contents from your home directory. If Pynguin generates a test for that particular code and execute it, it might whipe your home directory. Unfortunately, there is, to the best of my knowledge, no such thing as a security manager in Python (like it exists in Java), which would allow us more easily to prevent some of this potentially dangerous behaviour. Best, |
@stephanlukasczyk, exactly! ) in this module I have file creating, okay, thank you! |
Thanks for the nice feedback. I'll add a large warning hint into the documentation to avoid others struggling with this in the future. |
Hi, I installed pynguin==0.7.2
and run it with command
pynguin --algorithm WHOLE_SUITE --project_path /Users/iuliia_volkova2/work/simple-ddl-parser/temp --output_path testgen --module_name simple_ddl_parser.output.common
I got a dozens of strange named folders in project path (take a look at the screen).
And got the error )
Behaviour re-produceable.
Python 3.8.7
OS: Darwin (MacOS)
The text was updated successfully, but these errors were encountered: