Skip to content

Commit

Permalink
Re-use baked project for all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bouweandela committed Sep 29, 2023
1 parent a56c6c7 commit b62be05
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def run(args: Sequence[str], dirpath: os.PathLike) -> subprocess.CompletedProces
return completed_process


@pytest.fixture
def project_env_bin_dir(tmp_path):
@pytest.fixture(scope='session')
def project_env_bin_dir(tmp_path_factory):
tmp_path = tmp_path_factory.mktemp('venv')
env_output = run(['python', '-m', 'venv', 'env'], tmp_path)
assert env_output.returncode == 0
bin_dir = str(tmp_path / 'env' / 'bin')
Expand All @@ -38,12 +39,12 @@ def project_env_bin_dir(tmp_path):
return str(bin_dir) + os.sep


@pytest.fixture
def baked_with_development_dependencies(cookies, project_env_bin_dir):
result = cookies.bake()
@pytest.fixture(scope='session')
def baked_with_development_dependencies(cookies_session, project_env_bin_dir):
result = cookies_session.bake()
assert result.exit_code == 0
bin_dir = project_env_bin_dir
latest_pip_output = run([f'{bin_dir}python', '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools'], result.project)
latest_pip_output = run([f'{bin_dir}python', '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools'], result.project_path)
assert latest_pip_output.returncode == 0
pip_output = run([f'{bin_dir}python', '-m', 'pip', 'install', '--editable', '.[dev]'], result.project)
assert pip_output.returncode == 0
Expand Down

0 comments on commit b62be05

Please sign in to comment.