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

Clean-up Tests#329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
vmuriart wants to merge14 commits intopythonnet:masterfromvmuriart:unittests
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
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
2 changes: 1 addition & 1 deletion.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ addons:
- nunit-console

install:
- pip install pycparser coverage codecov six
- pip install pycparser coverage codecov
- coverage run setup.py build_ext --inplace

script:
Expand Down
2 changes: 1 addition & 1 deletionappveyor.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ init:

install:
# install for wheels & coverage
- pip install --upgrade pip wheel coverage codecov six
- pip install --upgrade pip wheel coverage codecov

# Install OpenCover. Can't put on packages.config; not Linux/Mono compatible
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages
Expand Down
5 changes: 1 addition & 4 deletionssrc/testing/arraytest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
{
//========================================================================
Expand DownExpand Up@@ -318,4 +315,4 @@ public static Spam[][] EchoRangeAA(Spam[][] items)
return items;
}
}
}
}
20 changes: 9 additions & 11 deletionssrc/testing/callbacktest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionssrc/testing/classtest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
Expand DownExpand Up@@ -61,4 +60,4 @@ public ClassCtorTest2(string v)
internal class InternalClass
{
}
}
}
3 changes: 1 addition & 2 deletionssrc/testing/constructortests.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.IO;

namespace Python.Test
Expand DownExpand Up@@ -50,4 +49,4 @@ public SubclassConstructorTest(Exception v)
this.value = v;
}
}
}
}
5 changes: 1 addition & 4 deletionssrc/testing/conversiontest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
using System;


namespace Python.Test
{
//========================================================================
Expand DownExpand Up@@ -58,4 +55,4 @@ public string GetValue()
return value;
}
}
}
}
4 changes: 1 addition & 3 deletionssrc/testing/delegatetest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
using System;

namespace Python.Test
{
//========================================================================
Expand DownExpand Up@@ -60,4 +58,4 @@ public bool CallBoolDelegate(BoolDelegate d)
return d();
}
}
}
}
14 changes: 7 additions & 7 deletionssrc/testing/doctest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionssrc/testing/enumtest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff 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
}
}
}
38 changes: 19 additions & 19 deletionssrc/testing/eventtest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,26 +6,26 @@ namespace Python.Test
// Supports CLR event unit tests.
//========================================================================

public delegate voidTestEventHandler(object sender,TestEventArgs e);
public delegate voidEventHandlerTest(object sender,EventArgsTest e);


public class EventTest
{
public static eventTestEventHandler PublicStaticEvent;
public static eventEventHandlerTest PublicStaticEvent;

protected static eventTestEventHandler ProtectedStaticEvent;
protected static eventEventHandlerTest ProtectedStaticEvent;

internal static eventTestEventHandler InternalStaticEvent;
internal static eventEventHandlerTest InternalStaticEvent;

private static eventTestEventHandler PrivateStaticEvent;
private static eventEventHandlerTest PrivateStaticEvent;

public eventTestEventHandler PublicEvent;
public eventEventHandlerTest PublicEvent;

protected eventTestEventHandler ProtectedEvent;
protected eventEventHandlerTest ProtectedEvent;

internal eventTestEventHandler InternalEvent;
internal eventEventHandlerTest InternalEvent;

private eventTestEventHandler PrivateEvent;
private eventEventHandlerTest PrivateEvent;


public static int s_value;
Expand All@@ -42,7 +42,7 @@ static EventTest()
}


public void OnPublicEvent(TestEventArgs e)
public void OnPublicEvent(EventArgsTest e)
{
if (PublicEvent != null)
{
Expand All@@ -51,7 +51,7 @@ public void OnPublicEvent(TestEventArgs e)
}


public void OnProtectedEvent(TestEventArgs e)
public void OnProtectedEvent(EventArgsTest e)
{
if (ProtectedEvent != null)
{
Expand All@@ -60,7 +60,7 @@ public void OnProtectedEvent(TestEventArgs e)
}


public static void OnPublicStaticEvent(TestEventArgs e)
public static void OnPublicStaticEvent(EventArgsTest e)
{
if (PublicStaticEvent != null)
{
Expand All@@ -69,7 +69,7 @@ public static void OnPublicStaticEvent(TestEventArgs e)
}


protected static void OnProtectedStaticEvent(TestEventArgs e)
protected static void OnProtectedStaticEvent(EventArgsTest e)
{
if (ProtectedStaticEvent != null)
{
Expand All@@ -78,12 +78,12 @@ protected static void OnProtectedStaticEvent(TestEventArgs e)
}


public void GenericHandler(object sender,TestEventArgs e)
public void GenericHandler(object sender,EventArgsTest e)
{
this.value = e.value;
}

public static void StaticHandler(object sender,TestEventArgs e)
public static void StaticHandler(object sender,EventArgsTest e)
{
s_value = e.value;
}
Expand All@@ -92,7 +92,7 @@ public static void ShutUpCompiler()
{
// Quiet compiler warnings.
EventTest e = new EventTest();
TestEventHandler f = newTestEventHandler(e.GenericHandler);
EventHandlerTest f = newEventHandlerTest(e.GenericHandler);
ProtectedStaticEvent += f;
InternalStaticEvent += f;
PrivateStaticEvent += f;
Expand All@@ -103,13 +103,13 @@ public static void ShutUpCompiler()
}


public classTestEventArgs : EventArgs
public classEventArgsTest : EventArgs
{
public int value;

publicTestEventArgs(int v)
publicEventArgsTest(int v)
{
this.value = v;
}
}
}
}
2 changes: 1 addition & 1 deletionsrc/testing/exceptiontest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -99,4 +99,4 @@ public string GetExtraInfo()
return extra;
}
}
}
}
5 changes: 1 addition & 4 deletionssrc/testing/fieldtest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
using System;


namespace Python.Test
{
//========================================================================
Expand DownExpand Up@@ -54,4 +51,4 @@ public void Shutup()
public object ObjectField;
public ISpam SpamField;
}
}
}
5 changes: 1 addition & 4 deletionssrc/testing/generictest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
{
//========================================================================
Expand DownExpand Up@@ -131,4 +128,4 @@ public static string Overloaded<Q>(int arg1, int arg2, string arg3)
return arg3;
}
}
}
}
4 changes: 1 addition & 3 deletionssrc/testing/globaltest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionssrc/testing/indexertest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections;

namespace Python.Test
Expand DownExpand Up@@ -415,4 +414,4 @@ public MultiDefaultKeyIndexerTest() : base()
}
}
}
}
}
4 changes: 1 addition & 3 deletionssrc/testing/interfacetest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
using System;

namespace Python.Test
{
//========================================================================
Expand DownExpand Up@@ -62,4 +60,4 @@ private interface IPrivate
{
}
}
}
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp