8000 Ensure that sys.argv is set by den-run-ai · Pull Request #301 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Ensure that sys.argv is set #301

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Separate into smaller tests
  • Loading branch information
vmuriart committed Feb 8, 2017
commit 2eef75feeef0c084b6dba5cd955ad0ebc5a112cb
20 changes: 13 additions & 7 deletions src/embed_tests/pyimport.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.IO;
using NUnit.Framework;
using Python.Runtime;
using System.IO;

namespace Python.EmbeddingTest
{
Expand Down Expand Up @@ -52,10 +50,18 @@ public void TearDown()
[Test]
public void TestDottedName()
{
PyObject module1 = PythonEngine.ImportModule("PyImportTest.test.one");
Assert.IsNotNull(module1, ">>> import PyImportTest.test.one # FAILED");
PyObject module2 = PythonEngine.ImportModule("PyImportTest.sysargv");
Assert.IsNotNull(module2, ">>> import PyImportTest.sysargv # FAILED");
PyObject module = PythonEngine.ImportModule("PyImportTest.test.one");
Assert.IsNotNull(module, ">>> import PyImportTest.test.one # FAILED");
}

/// <summary>
/// Tests that sys.args is set. If it wasn't exception would be raised.
/// </summary>
[Test]
public void TestSysArgsImportException()
{
PyObject module = PythonEngine.ImportModule("PyImportTest.sysargv");
Assert.IsNotNull(module, ">>> import PyImportTest.sysargv # FAILED");
}
}
}
0