code: def test_virtualenv_project_no_env_file(
      create_virtualenv_spy, tmp_path
  ):
      """
      When neither python_env.yaml nor conda.yaml is present, virtualenv should be used as an
      environment manager.
      """
      ml_project_file = tmp_path.joinpath("MLproject")
      ml_project_file.write_text(
          """
  name: test
  entry_points:
    main:
      command: |
        python test.py
  """
      )
      tmp_path.joinpath("test.py").write_text(
          """
  import os
  
  assert "VIRTUAL_ENV" in os.environ
  """
      )
      mlflow.projects.run(str(tmp_path))
      create_virtualenv_spy.assert_called_once()
  
file_path: mlflow/tests/projects/test_virtualenv_projects.py
imports: import os
  from unittest import mock
  import pytest
  import mlflow
  from mlflow.exceptions import MlflowException
  from mlflow.utils.file_utils import read_yaml, write_yaml
  from mlflow.utils.virtualenv import _create_virtualenv
  from tests.projects.utils import TEST_VIRTUALENV_CONDA_PROJECT_DIR, TEST_VIRTUALENV_NO_PYTHON_ENV, TEST_VIRTUALENV_PROJECT_DIR
label_desc: Use image node_id 8 for calling a global function with example usage: test_virtualenv_project_no_env_file(create_virtualenv_spy, tmp_path) without return types