Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38af8d1

Browse files
committed
Split and re-order TestPyTupleIsTupleType test
1 parent bd1a27e commit 38af8d1

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

src/embed_tests/pytuple.cs

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ namespace Python.EmbeddingTest
55
{
66
public class PyTupleTest
77
{
8+
/// <summary>
9+
/// Test IsTupleType without having to Initialize a tuple.
10+
/// PyTuple constructor use IsTupleType. This decouples the tests.
11+
/// </summary>
12+
[Test]
13+
public void TestStringIsTupleType()
14+
{
15+
using (Py.GIL())
16+
{
17+
var s = new PyString("foo");
18+
Assert.IsFalse(PyTuple.IsTupleType(s));
19+
}
20+
}
21+
22+
/// <summary>
23+
/// Test IsTupleType with Tuple.
24+
/// </summary>
25+
[Test]
26+
public void TestPyTupleIsTupleType()
27+
{
28+
using (Py.GIL())
29+
{
30+
var t = new PyTuple();
31+
Assert.IsTrue(PyTuple.IsTupleType(t));
32+
}
33+
}
34+
835
[Test]
936
public void TestPyTupleEmpty()
1037
{
@@ -39,18 +66,6 @@ public void TestPyTupleValidAppend()
3966
}
4067
}
4168

42-
[Test]
43-
public void TestPyTupleIsTupleType()
44-
{
45-
using (Py.GIL())
46-
{
47-
var s = new PyString("foo");
48-
var t = new PyTuple();
49-
Assert.IsTrue(PyTuple.IsTupleType(t));
50-
Assert.IsFalse(PyTuple.IsTupleType(s));
51-
}
52-
}
53-
5469
[Test]
5570
public void TestPyTupleStringConvert()
5671
{

0 commit comments

Comments
 (0)