Skip to content
Prev Previous commit
Next Next commit
Remove unused using from testing and format
  • Loading branch information
vmuriart committed Jan 31, 2017
commit 2ae78cca2a75bbb180441fffde8fde05a9251560
5 changes: 1 addition & 4 deletions src/testing/arraytest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -318,4 +315,4 @@ public static Spam[][] EchoRangeAA(Spam[][] items)
return items;
}
}
}
}
20 changes: 9 additions & 11 deletions src/testing/callbacktest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Python.Runtime;

namespace Python.Test
{
Expand All @@ -13,32 +10,33 @@ public class CallbackTest
{
public string Call_simpleDefaultArg_WithNull(string moduleName)
{
using (Runtime.Py.GIL())
using (Py.GIL())
{
dynamic module = Runtime.Py.Import(moduleName);
dynamic module = Py.Import(moduleName);
return module.simpleDefaultArg(null);
}
}

public string Call_simpleDefaultArg_WithEmptyArgs(string moduleName)
{
using (Runtime.Py.GIL())
using (Py.GIL())
{
dynamic module = Runtime.Py.Import(moduleName);
dynamic module = Py.Import(moduleName);
return module.simpleDefaultArg();
}
}
}

//==========================================================================
// Tests calling from Python into C# and back into Python using a PyObject.
// SelfCallbackTest should be inherited by a Python class.
// SelfCallbackTest should be inherited by a Python class.
// Used in test_class.py / testCallback
//==========================================================================
public class SelfCallbackTest
{
public void Callback(Runtime.PyObject self)
public void Callback(PyObject self)
{
using (Runtime.Py.GIL())
using (Py.GIL())
((dynamic)self).PyCallback(self);
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/testing/classtest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
Expand Down Expand Up @@ -61,4 +60,4 @@ public ClassCtorTest2(string v)
internal class InternalClass
{
}
}
}
3 changes: 1 addition & 2 deletions src/testing/constructortests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.IO;

namespace Python.Test
Expand Down Expand Up @@ -50,4 +49,4 @@ public SubclassConstructorTest(Exception v)
this.value = v;
}
}
}
}
5 changes: 1 addition & 4 deletions src/testing/conversiontest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;


namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -58,4 +55,4 @@ public string GetValue()
return value;
}
}
}
}
4 changes: 1 addition & 3 deletions src/testing/delegatetest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -60,4 +58,4 @@ public bool CallBoolDelegate(BoolDelegate d)
return d();
}
}
}
}
14 changes: 7 additions & 7 deletions src/testing/doctest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ namespace Python.Test

// Classes with a constructor have their docstring set to the ctor signature.
// Test if a class has an explicit doc string it gets set correctly.
[DocStringAttribute("DocWithCtorTest Class")]
[DocString("DocWithCtorTest Class")]
public class DocWithCtorTest
{
public DocWithCtorTest()
{
}

[DocStringAttribute("DocWithCtorTest TestMethod")]
[DocString("DocWithCtorTest TestMethod")]
public void TestMethod()
{
}

[DocStringAttribute("DocWithCtorTest StaticTestMethod")]
[DocString("DocWithCtorTest StaticTestMethod")]
public static void StaticTestMethod()
{
}
Expand All @@ -41,17 +41,17 @@ public static void StaticTestMethod(double a, int b)
}
}

[DocStringAttribute("DocWithoutCtorTest Class")]
[DocString("DocWithoutCtorTest Class")]
public class DocWithoutCtorTest
{
[DocStringAttribute("DocWithoutCtorTest TestMethod")]
[DocString("DocWithoutCtorTest TestMethod")]
public void TestMethod()
{
}

[DocStringAttribute("DocWithoutCtorTest StaticTestMethod")]
[DocString("DocWithoutCtorTest StaticTestMethod")]
public static void StaticTestMethod()
{
}
}
}
}
4 changes: 2 additions & 2 deletions src/testing/enumtest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public enum ULongEnum : ulong
Five
}

[FlagsAttribute]
[Flags]
public enum FlagsEnum
{
Zero,
Expand All @@ -96,4 +96,4 @@ public enum FlagsEnum
Four,
Five
}
}
}
2 changes: 1 addition & 1 deletion src/testing/exceptiontest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ public string GetExtraInfo()
return extra;
}
}
}
}
5 changes: 1 addition & 4 deletions src/testing/fieldtest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;


namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -54,4 +51,4 @@ public void Shutup()
public object ObjectField;
public ISpam SpamField;
}
}
}
5 changes: 1 addition & 4 deletions src/testing/generictest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -131,4 +128,4 @@ public static string Overloaded<Q>(int arg1, int arg2, string arg3)
return arg3;
}
}
}
}
4 changes: 1 addition & 3 deletions src/testing/globaltest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;

//========================================================================
// Supports units tests for access to types without a namespace.
//========================================================================

public class NoNamespaceType
{
}
}
3 changes: 1 addition & 2 deletions src/testing/indexertest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
Expand Down Expand Up @@ -415,4 +414,4 @@ public MultiDefaultKeyIndexerTest() : base()
}
}
}
}
}
4 changes: 1 addition & 3 deletions src/testing/interfacetest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -62,4 +60,4 @@ private interface IPrivate
{
}
}
}
}
7 changes: 3 additions & 4 deletions src/testing/methodtest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Collections.Generic;

namespace Python.Test
{
Expand Down Expand Up @@ -156,13 +155,13 @@ public static bool TestValueRefParams(string s, ref int i1)

public static bool TestObjectOutParams(object o, out object o1)
{
o1 = new System.Exception("test");
o1 = new Exception("test");
return true;
}

public static bool TestObjectRefParams(object o, ref object o1)
{
o1 = new System.Exception("test");
o1 = new Exception("test");
return true;
}

Expand Down Expand Up @@ -630,4 +629,4 @@ public string PublicMethod(string echo)
return echo;
}
}
}
}
12 changes: 8 additions & 4 deletions src/testing/moduletest.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
using System;
using System.Threading;

namespace Python.Test {
public class ModuleTest {
namespace Python.Test
{
public class ModuleTest
{
private static Thread _thread;

public static void RunThreads()
{
_thread = new Thread(() => {
_thread = new Thread(() =>
{
var appdomain = AppDomain.CurrentDomain;
var assemblies = appdomain.GetAssemblies();
foreach (var assembly in assemblies) {
foreach (var assembly in assemblies)
{
assembly.GetTypes();
}
});
Expand Down
4 changes: 1 addition & 3 deletions src/testing/propertytest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Python.Test
{
//========================================================================
Expand Down Expand Up @@ -84,4 +82,4 @@ public ShortEnum EnumProperty
set { _enum_property = value; }
}
}
}
}
3 changes: 0 additions & 3 deletions src/testing/subclasstest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Python.Test
{
Expand Down Expand Up @@ -70,7 +68,6 @@ public class SubClass : RecursiveInheritance
{
public void SomeMethod()
{

}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/testing/threadtest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using Python.Runtime;

namespace Python.Test
Expand Down Expand Up @@ -77,4 +76,4 @@ public static string CallEchoString2(string arg)
}
}
}
}
}