Fix test to not write to project directory
Why:
* The test generated some files in the project folder
* We want them to be generated in a temporary folder that is removed
afterwards
import importlib
import logging
import os
+import shutil
import tempfile
from argparse import ArgumentParser
from unittest import mock
@@ -91,8 +92,11 @@ def test_init_with_cli_arguments(configuration):
def test_run(configuration):
+ tmp_dir = tempfile.mkdtemp()
+ configuration.output_folder = tmp_dir
generator = Pynguin(configuration=configuration)
assert generator.run() == 0
+ shutil.rmtree(tmp_dir)
def test_run_without_logger(configuration):
