Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import shutil
import subprocess
import tempfile
import json
from parameterized import parameterized
Expand All @@ -14,6 +15,7 @@
from aws_lambda_builders.builder import LambdaBuilder
from aws_lambda_builders.architecture import ARM64, X86_64
from aws_lambda_builders.supported_runtimes import DOTNET_RUNTIMES
from aws_lambda_builders.workflows.dotnet_clipackage.actions import GlobalToolInstallAction


def get_dotnet_test_params():
Expand Down Expand Up @@ -54,6 +56,13 @@ def setUp(self):
self.artifacts_dir = tempfile.mkdtemp()
self.scratch_dir = tempfile.mkdtemp()
self.builder = LambdaBuilder(language="dotnet", dependency_manager="cli-package", application_framework=None)
# Reset cached install state and uninstall any pre-existing Amazon.Lambda.Tools
# so each test exercises the actual install path.
GlobalToolInstallAction._GlobalToolInstallAction__tools_installed = False
subprocess.run(
["dotnet", "tool", "uninstall", "-g", "Amazon.Lambda.Tools"],
capture_output=True,
)

def tearDown(self):
shutil.rmtree(self.artifacts_dir)
Expand Down
Loading