Skip to content

Commit 907a633

Browse files
committed
Remove unused using from testing and format
1 parent 4162a29 commit 907a633

19 files changed

+42
-68
lines changed

src/testing/arraytest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Collections;
3-
41
namespace Python.Test
52
{
63
//========================================================================
@@ -318,4 +315,4 @@ public static Spam[][] EchoRangeAA(Spam[][] items)
318315
return items;
319316
}
320317
}
321-
}
318+
}

src/testing/callbacktest.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
1+
using Python.Runtime;
52

63
namespace Python.Test
74
{
@@ -13,32 +10,33 @@ public class CallbackTest
1310
{
1411
public string Call_simpleDefaultArg_WithNull(string moduleName)
1512
{
16-
using (Runtime.Py.GIL())
13+
using (Py.GIL())
1714
{
18-
dynamic module = Runtime.Py.Import(moduleName);
15+
dynamic module = Py.Import(moduleName);
1916
return module.simpleDefaultArg(null);
2017
}
2118
}
19+
2220
public string Call_simpleDefaultArg_WithEmptyArgs(string moduleName)
2321
{
24-
using (Runtime.Py.GIL())
22+
using (Py.GIL())
2523
{
26-
dynamic module = Runtime.Py.Import(moduleName);
24+
dynamic module = Py.Import(moduleName);
2725
return module.simpleDefaultArg();
2826
}
2927
}
3028
}
3129

3230
//==========================================================================
3331
// Tests calling from Python into C# and back into Python using a PyObject.
34-
// SelfCallbackTest should be inherited by a Python class.
32+
// SelfCallbackTest should be inherited by a Python class.
3533
// Used in test_class.py / testCallback
3634
//==========================================================================
3735
public class SelfCallbackTest
3836
{
39-
public void Callback(Runtime.PyObject self)
37+
public void Callback(PyObject self)
4038
{
41-
using (Runtime.Py.GIL())
39+
using (Py.GIL())
4240
((dynamic)self).PyCallback(self);
4341
}
4442
}

src/testing/classtest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections;
32

43
namespace Python.Test
@@ -61,4 +60,4 @@ public ClassCtorTest2(string v)
6160
internal class InternalClass
6261
{
6362
}
64-
}
63+
}

src/testing/constructortests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections;
32
using System.IO;
43

54
namespace Python.Test
@@ -50,4 +49,4 @@ public SubclassConstructorTest(Exception v)
5049
this.value = v;
5150
}
5251
}
53-
}
52+
}

src/testing/conversiontest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
3-
41
namespace Python.Test
52
{
63
//========================================================================
@@ -58,4 +55,4 @@ public string GetValue()
5855
return value;
5956
}
6057
}
61-
}
58+
}

src/testing/delegatetest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace Python.Test
42
{
53
//========================================================================
@@ -60,4 +58,4 @@ public bool CallBoolDelegate(BoolDelegate d)
6058
return d();
6159
}
6260
}
63-
}
61+
}

src/testing/doctest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ namespace Python.Test
88

99
// Classes with a constructor have their docstring set to the ctor signature.
1010
// Test if a class has an explicit doc string it gets set correctly.
11-
[DocStringAttribute("DocWithCtorTest Class")]
11+
[DocString("DocWithCtorTest Class")]
1212
public class DocWithCtorTest
1313
{
1414
public DocWithCtorTest()
1515
{
1616
}
1717

18-
[DocStringAttribute("DocWithCtorTest TestMethod")]
18+
[DocString("DocWithCtorTest TestMethod")]
1919
public void TestMethod()
2020
{
2121
}
2222

23-
[DocStringAttribute("DocWithCtorTest StaticTestMethod")]
23+
[DocString("DocWithCtorTest StaticTestMethod")]
2424
public static void StaticTestMethod()
2525
{
2626
}
@@ -41,17 +41,17 @@ public static void StaticTestMethod(double a, int b)
4141
}
4242
}
4343

44-
[DocStringAttribute("DocWithoutCtorTest Class")]
44+
[DocString("DocWithoutCtorTest Class")]
4545
public class DocWithoutCtorTest
4646
{
47-
[DocStringAttribute("DocWithoutCtorTest TestMethod")]
47+
[DocString("DocWithoutCtorTest TestMethod")]
4848
public void TestMethod()
4949
{
5050
}
5151

52-
[DocStringAttribute("DocWithoutCtorTest StaticTestMethod")]
52+
[DocString("DocWithoutCtorTest StaticTestMethod")]
5353
public static void StaticTestMethod()
5454
{
5555
}
5656
}
57-
}
57+
}

src/testing/enumtest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public enum ULongEnum : ulong
8686
Five
8787
}
8888

89-
[FlagsAttribute]
89+
[Flags]
9090
public enum FlagsEnum
9191
{
9292
Zero,
@@ -96,4 +96,4 @@ public enum FlagsEnum
9696
Four,
9797
Five
9898
}
99-
}
99+
}

src/testing/exceptiontest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ public string GetExtraInfo()
9999
return extra;
100100
}
101101
}
102-
}
102+
}

src/testing/fieldtest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
3-
41
namespace Python.Test
52
{
63
//========================================================================
@@ -54,4 +51,4 @@ public void Shutup()
5451
public object ObjectField;
5552
public ISpam SpamField;
5653
}
57-
}
54+
}

0 commit comments

Comments
 (0)