static SendToReplTests() { AssertListener.Initialize(); PythonTestData.Deploy(); }
static BaseDebuggerTests() { AssertListener.Initialize(); }
static IronPythonReplEvaluatorTests() { AssertListener.Initialize(); }
static DatabaseTest27() { AssertListener.Initialize(); }
static MutateStdLibTest() { AssertListener.Initialize(); }
public static void DoDeployment(TestContext context) { AssertListener.Initialize(); PythonTestData.Deploy(includeTestData: false); }
public static void DoDeployment(TestContext context) { AssertListener.Initialize(); VsProjectAnalyzer.DefaultTimeout = 10000; VsProjectAnalyzer.AssertOnRequestFailure = true; }
public static new void DoDeployment(TestContext context) { AssertListener.Initialize(); PythonTestData.Deploy(); }
static BuildTasksUI27Tests() { AssertListener.Initialize(); PythonTestData.Deploy(); }
public void TestInitialize() { AnalysisLog.Reset(); AssertListener.Initialize(); }
public static void DoDeployment(TestContext context) { AssertListener.Initialize(); NodejsUwpTestData.Deploy(); }
static BaseAnalysisTest() { AnalysisLog.Reset(); AssertListener.Initialize(); }
public static void DoDeployment(TestContext context) { AssertListener.Initialize(); AstPythonInterpreterFactory.LogToConsole = true; }
public override void DoDeployment(TestContext context) { AssertListener.Initialize(); }
public static void Initialize(TestContext context) { AssertListener.Initialize(); }
static BaseDebuggerTests() { AssertListener.Initialize(); PythonTestData.Deploy(); }
static ReplWindowPythonSmokeTests() { PythonTestData.Deploy(); AssertListener.Initialize(); }
static DatabaseTest27() { AssertListener.Initialize(); PythonTestData.Deploy(includeTestData: false); }
static IronPythonReplEvaluatorTests() { AssertListener.Initialize(); PythonTestData.Deploy(includeTestData: false); }
public static void DoDeployment(TestContext context) { AssertListener.Initialize(); ExtractResource("ruleFormattingTests.json"); }
public static void DoDeployment(TestContext context) { AssertListener.Initialize(); }
private IVsHostedPythonToolsTestResult InvokeTest(Type type, MethodInfo method, object[] arguments) { object instance; if (!_activeInstances.TryGetValue(type, out instance)) { instance = Activator.CreateInstance(type); _activeInstances[type] = instance; } var args = new List <object>(); var inputArgs = arguments.ToList(); var sp = ServiceProvider.GlobalProvider; var dte = ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)); try { try { var shell = (IVsShell)ServiceProvider.GlobalProvider.GetService(typeof(SVsShell)); foreach (var guid in _dependentPackageGuids) { int installed; var pkgGuid = guid; ErrorHandler.ThrowOnFailure( shell.IsPackageInstalled(ref pkgGuid, out installed) ); if (installed == 0) { throw new NotSupportedException($"Package {pkgGuid} is not installed"); } ErrorHandler.ThrowOnFailure(shell.LoadPackage(pkgGuid, out _)); } } catch (Exception ex) { return(new HostedPythonToolsTestResult { IsSuccess = false, ExceptionType = ex.GetType().FullName, ExceptionMessage = "Failed to load a dependent VS package." + Environment.NewLine + ex.Message, ExceptionTraceback = ex.StackTrace }); } foreach (var a in method.GetParameters()) { if (a.ParameterType.IsAssignableFrom(typeof(IServiceProvider))) { args.Add(sp); } else if (a.ParameterType.IsAssignableFrom(typeof(EnvDTE.DTE))) { args.Add(dte); } else if (inputArgs.Count > 0 && a.ParameterType.IsAssignableFrom(inputArgs[0].GetType())) { args.Add(inputArgs[0]); inputArgs.RemoveAt(0); } else { args.Add(ConstructParameter(a.ParameterType, sp, dte, inputArgs)); } } } catch (Exception ex) { return(new HostedPythonToolsTestResult { IsSuccess = false, ExceptionType = ex.GetType().FullName, ExceptionMessage = "Failed to invoke test method with correct arguments." + Environment.NewLine + ex.Message, ExceptionTraceback = ex.StackTrace }); } AssertListener.Initialize(); try { try { if (typeof(Task).IsAssignableFrom(method.ReturnType)) { ThreadHelper.JoinableTaskFactory.Run(() => (Task)method.Invoke(instance, args.ToArray())); } else { method.Invoke(instance, args.ToArray()); } AssertListener.ThrowUnhandled(); } finally { foreach (var a in args) { if (a == sp || a == dte) { continue; } (a as IDisposable)?.Dispose(); } } } catch (Exception ex) { if (ex is TargetInvocationException || ex is AggregateException) { ex = ex.InnerException; } return(new HostedPythonToolsTestResult { IsSuccess = false, ExceptionType = ex.GetType().FullName, ExceptionMessage = ex.Message, ExceptionTraceback = ex.StackTrace }); } return(new HostedPythonToolsTestResult { IsSuccess = true }); }