Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit905884c

Browse files
committed
Merge pull request#329 from vmuriart/unittests
Closes#329
2 parents43de985 +400f688 commit905884c

File tree

59 files changed

+3455
-4350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3455
-4350
lines changed

‎.travis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ addons:
2525
-nunit-console
2626

2727
install:
28-
-pip install pycparser coverage codecov six
28+
-pip install pycparser coverage codecov
2929
-coverage run setup.py build_ext --inplace
3030

3131
script:

‎appveyor.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ init:
4646

4747
install:
4848
# install for wheels & coverage
49-
-pip install --upgrade pip wheel coverage codecov six
49+
-pip install --upgrade pip wheel coverage codecov
5050

5151
# Install OpenCover. Can't put on packages.config; not Linux/Mono compatible
5252
-.\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages

‎src/testing/arraytest.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
usingSystem;
2-
usingSystem.Collections;
3-
41
namespacePython.Test
52
{
63
//========================================================================
@@ -318,4 +315,4 @@ public static Spam[][] EchoRangeAA(Spam[][] items)
318315
returnitems;
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-
usingSystem;
2-
usingSystem.Collections.Generic;
3-
usingSystem.Linq;
4-
usingSystem.Text;
1+
usingPython.Runtime;
52

63
namespacePython.Test
74
{
@@ -13,32 +10,33 @@ public class CallbackTest
1310
{
1411
publicstringCall_simpleDefaultArg_WithNull(stringmoduleName)
1512
{
16-
using(Runtime.Py.GIL())
13+
using(Py.GIL())
1714
{
18-
dynamicmodule=Runtime.Py.Import(moduleName);
15+
dynamicmodule=Py.Import(moduleName);
1916
returnmodule.simpleDefaultArg(null);
2017
}
2118
}
19+
2220
publicstringCall_simpleDefaultArg_WithEmptyArgs(stringmoduleName)
2321
{
24-
using(Runtime.Py.GIL())
22+
using(Py.GIL())
2523
{
26-
dynamicmodule=Runtime.Py.Import(moduleName);
24+
dynamicmodule=Py.Import(moduleName);
2725
returnmodule.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
publicclassSelfCallbackTest
3836
{
39-
publicvoidCallback(Runtime.PyObjectself)
37+
publicvoidCallback(PyObjectself)
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-
usingSystem;
21
usingSystem.Collections;
32

43
namespacePython.Test
@@ -61,4 +60,4 @@ public ClassCtorTest2(string v)
6160
internalclassInternalClass
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
usingSystem;
2-
usingSystem.Collections;
32
usingSystem.IO;
43

54
namespacePython.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-
usingSystem;
2-
3-
41
namespacePython.Test
52
{
63
//========================================================================
@@ -58,4 +55,4 @@ public string GetValue()
5855
returnvalue;
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-
usingSystem;
2-
31
namespacePython.Test
42
{
53
//========================================================================
@@ -60,4 +58,4 @@ public bool CallBoolDelegate(BoolDelegate d)
6058
returnd();
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
publicclassDocWithCtorTest
1313
{
1414
publicDocWithCtorTest()
1515
{
1616
}
1717

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

23-
[DocStringAttribute("DocWithCtorTest StaticTestMethod")]
23+
[DocString("DocWithCtorTest StaticTestMethod")]
2424
publicstaticvoidStaticTestMethod()
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
publicclassDocWithoutCtorTest
4646
{
47-
[DocStringAttribute("DocWithoutCtorTest TestMethod")]
47+
[DocString("DocWithoutCtorTest TestMethod")]
4848
publicvoidTestMethod()
4949
{
5050
}
5151

52-
[DocStringAttribute("DocWithoutCtorTest StaticTestMethod")]
52+
[DocString("DocWithoutCtorTest StaticTestMethod")]
5353
publicstaticvoidStaticTestMethod()
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
publicenumFlagsEnum
9191
{
9292
Zero,
@@ -96,4 +96,4 @@ public enum FlagsEnum
9696
Four,
9797
Five
9898
}
99-
}
99+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp