8000 Separate into smaller tests · pythonnet/pythonnet@2eef75f · GitHub
[go: up one dir, main page]

Skip to content

Commit 2eef75f

Browse files
committed
Separate into smaller tests
1 parent 2d6f371 commit 2eef75f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/embed_tests/pyimport.cs

Lines changed: 13 additions & 7 deletions
8D67
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using System;
2-
using System.Reflection;
3-
using System.Collections.Generic;
2+
using System.IO;
43
using NUnit.Framework;
54
using Python.Runtime;
6-
using System.IO;
75

86
namespace Python.EmbeddingTest
97
{
@@ -52,10 +50,18 @@ public void TearDown()
5250
[Test]
5351
public void TestDottedName()
5452
{
55-
PyObject module1 = PythonEngine.ImportModule("PyImportTest.test.one");
56-
Assert.IsNotNull(module1, ">>> import PyImportTest.test.one # FAILED");
57-
PyObject module2 = PythonEngine.ImportModule("PyImportTest.sysargv");
58-
Assert.IsNotNull(module2, ">>> import PyImportTest.sysargv # FAILED");
53+
PyObject module = PythonEngine.ImportModule("PyImportTest.test.one");
54+
Assert.IsNotNull(module, ">>> import PyImportTest.test.one # FAILED");
55+
}
56+
57+
/// <summary>
58+
/// Tests that sys.args is set. If it wasn't exception would be raised.
59+
/// </summary>
60+
[Test]
61+
public void TestSysArgsImportException()
62+
{
63+
PyObject module = PythonEngine.ImportModule("PyImportTest.sysargv");
64+
Assert.IsNotNull(module, ">>> import PyImportTest.sysargv # FAILED");
5965
}
6066
}
6167
}

0 commit comments

Comments
 (0)
0