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

Enable Travis Embedded Tests#391

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

Merged
vmuriart merged 1 commit intopythonnet:masterfromvmuriart:travis-embedded_tests
Feb 22, 2017
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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@@ -42,7 +42,7 @@ script:
- python -m pytest

- cp Python.Runtime.dll.config src/embed_tests/bin/
#- mono ./packages/NUnit.*/tools/nunit3-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
- mono ./packages/NUnit.*/tools/nunit3-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll

after_script:
# Uncomment if need to geninterop, ie. py37 final
Expand Down
17 changes: 16 additions & 1 deletionsrc/embed_tests/dynamic.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,20 +58,35 @@ public void AssignNone()
/// Check whether we can get the attr of a python object when the
/// value of attr is a PyObject.
/// </summary>
/// <remarks>
/// FIXME: Issue on Travis PY27: Error : Python.EmbeddingTest.dynamicTest.AssignPyObject
/// Python.Runtime.PythonException : ImportError : /home/travis/virtualenv/python2.7.9/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyLong_AsInt
/// </remarks>
[Test]
public void AssignPyObject()
{
if (Environment.GetEnvironmentVariable("TRAVIS") == "true" &&
Environment.GetEnvironmentVariable("TRAVIS_PYTHON_VERSION") == "2.7")
{
// Most recently threw `auto-releasing thread-state, but no thread-state for this thread`
// instead of the error below. Maybe had bad mapping to library?
Assert.Ignore("Fails on Travis/PY27: ImportError: ... undefined symbol: _PyLong_AsInt");
}

dynamic sys = Py.Import("sys");
dynamic io = Py.Import("io");
sys.testattr = io.StringIO();
dynamic bb = sys.testattr; //Get the PyObject
dynamic bb = sys.testattr; //Get the PyObject
bb.write("Hello!");
Assert.AreEqual(bb.getvalue().ToString(), "Hello!");
}

/// <summary>
/// Pass the .NET object in Python side.
/// </summary>
/// <remarks>
/// FIXME: Possible source of intermittent Travis PY27: Unable to unload AppDomain.
/// </remarks>
[Test]
public void PassObjectInPython()
{
Expand Down
5 changes: 5 additions & 0 deletionssrc/embed_tests/pyinitialize.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,11 @@ public static void LoadDefaultArgs()
[Test]
public static void LoadSpecificArgs()
{
if (Environment.GetEnvironmentVariable("TRAVIS") == "true" &&
Environment.GetEnvironmentVariable("TRAVIS_PYTHON_VERSION") != "2.7")
{
Assert.Ignore("FIXME: Fails on Travis/PY3+: Fatal Python error: no mem for sys.argv");
}
var args = new[] { "test1", "test2" };
using (new PythonEngine(args))
using (var argv = new PyList(Runtime.Runtime.PySys_GetObject("argv")))
Expand Down
28 changes: 28 additions & 0 deletionssrc/embed_tests/pytuple.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,10 +6,37 @@ namespace Python.EmbeddingTest
{
public class PyTupleTest
{
/// <summary>
/// Tests set-up. Being used to skip class on Travis/PY27
/// </summary>
/// <remarks>
/// FIXME: Fails on Travis/PY27: All tests below (unless otherwise stated)
/// Fatal Python error: auto-releasing thread-state, but no thread-state for this thread
/// Stacktrace:
/// at (wrapper managed-to-native) Python.Runtime.Runtime.PyGILState_Release (intptr)
/// at Python.Runtime.PythonEngine.ReleaseLock (intptr)
/// at Python.Runtime.PythonException.Dispose ()
/// at Python.Runtime.PythonException.Finalize ()
/// at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)
/// </remarks>
[SetUp]
public void SetUp()
{
if (Environment.GetEnvironmentVariable("TRAVIS") == "true" &&
Environment.GetEnvironmentVariable("TRAVIS_PYTHON_VERSION") == "2.7")
{
Assert.Ignore("Fails on Travis/PY27: Fatal Python error: auto-releasing thread-state, but no thread-state for this thread");
}
}

/// <summary>
/// Test IsTupleType without having to Initialize a tuple.
/// PyTuple constructor use IsTupleType. This decouples the tests.
/// </summary>
/// <remarks>
/// Travis PY27 intermittently fails this test. Indicates issue is
/// most likely with PyTuple.IsTupleType
/// </remarks>
[Test]
public void TestStringIsTupleType()
{
Expand DownExpand Up@@ -104,6 +131,7 @@ public void TestPyTupleValidConvert()

/// <remarks>
/// FIXME: Possible source of intermittent AppVeyor PY27: Unable to unload AppDomain.
/// FIXME: Intermittent Issue on Travis PY33: Fatal Python error: PyMUTEX_LOCK(gil_mutex) failed. Seen twice.
/// </remarks>
[Test]
public void TestNewPyTupleFromPyTuple()
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp