8000 Addressing code review comments · pythonnet/pythonnet@28a0d1e · GitHub
[go: up one dir, main page]

Skip to content

Commit 28a0d1e

Browse files
author
John Wilkes
committed
Addressing code review comments
This reverts commit 56e5268.
1 parent 56e5268 commit 28a0d1e

File tree

3 files changed

+16
-54
lines changed

3 files changed

+16
-54
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
-   Jeff Reback ([@jreback](https://github.com/jreback))
2929
- Joe Frayne ([@jfrayne](https://github.com/jfrayne))
3030
- John Burnett ([@johnburnett](https://github.com/johnburnett))
31+
- John Wilkes ([@jbw3](https://github.com/jbw3))
3132
- Luke Stratman ([@lstratman](https://github.com/lstratman))
3233
- Konstantin Posudevskiy ([@konstantin-posudevskiy](https://github.com/konstantin-posudevskiy))
3334
- Matthias Dittrich ([@matthid](https://github.com/matthid))

src/embed_tests/Python.EmbeddingTest.csproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,41 +26,45 @@
2626
</PropertyGroup>
2727
<PropertyGroup Condition=" '$(Configuration)' == 'DebugMono'">
2828
<DebugSymbols>true</DebugSymbols>
29-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4;TRACE;DEBUG</DefineConstants>
29+
<DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants>
3030
<DebugType>full</DebugType>
3131
</PropertyGroup>
3232
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMono'">
33-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4</DefineConstants>
33+
<DefineConstants Condition="'$(DefineConstants)' == ''">
34+
</DefineConstants>
3435
<Optimize>true</Optimize>
3536
<DebugType>pdbonly</DebugType>
3637
</PropertyGroup>
3738
<PropertyGroup Condition=" '$(Configuration)' == 'DebugWin'">
3839
<DebugSymbols>true</DebugSymbols>
39-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS2;TRACE;DEBUG</DefineConstants>
40+
<DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants>
4041
<DebugType>full</DebugType>
4142
</PropertyGroup>
4243
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseWin'">
43-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS2</DefineConstants>
44+
<DefineConstants Condition="'$(DefineConstants)' == ''">
45+
</DefineConstants>
4446
<Optimize>true</Optimize>
4547
<DebugType>pdbonly</DebugType>
4648
</PropertyGroup>
4749
<PropertyGroup Condition=" '$(Configuration)' == 'DebugMonoPY3'">
4850
<DebugSymbols>true</DebugSymbols>
49-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS4;TRACE;DEBUG</DefineConstants>
51+
<DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants>
5052
<DebugType>full</DebugType>
5153
</PropertyGroup>
5254
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMonoPY3'">
53-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS4</DefineConstants>
55+
<DefineConstants Condition="'$(DefineConstants)' == ''">
56+
</DefineConstants>
5457
<Optimize>true</Optimize>
5558
<DebugType>pdbonly</DebugType>
5659
</PropertyGroup>
5760
<PropertyGroup Condition=" '$(Configuration)' == 'DebugWinPY3'">
5861
<DebugSymbols>true</DebugSymbols>
59-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS2;TRACE;DEBUG</DefineConstants>
62+
<DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants>
6063
<DebugType>full</DebugType>
6164
</PropertyGroup>
6265
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseWinPY3'">
63-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS2</DefineConstants>
66+
<DefineConstants Condition="'$(DefineConstants)' == ''">
67+
</DefineConstants>
6468
<Optimize>true</Optimize>
6569
<DebugType>pdbonly</DebugType>
6670
</PropertyGroup>

src/embed_tests/TestPyObject.cs

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,6 @@ public void TestGetDynamicMemberNames()
2525
{
2626
List<string> expectedMemberNames = new List<string>
2727
{
28-
"__class__",
29-
"__delattr__",
30-
"__dict__",
31-
#if PYTHON3
32-
"__dir__",
33-
#endif
34-
"__doc__",
35-
#if PYTHON3
36-
"__eq__",
37-
#endif
38-
"__format__",
39-
#if PYTHON3
40-
"__ge__",
41-
#endif
42-
"__getattribute__",
43-
#if PYTHON3
44-
"__gt__",
45-
#endif
46-
"__hash__",
47-
"__init__",
48-
#if PYTHON36
49-
"__init_subclass__",
50-
#endif
51-
#if PYTHON3
52-
"__le__",
53-
"__lt__",
54-
#endif
55-
"__module__",
56-
#if PYTHON3
57-
"__ne__",
58-
#endif
59-
"__new__",
60-
"__reduce__",
61-
"__reduce_ex__",
62-
"__repr__",
63-
"__setattr__",
64-
"__sizeof__",
65-
"__str__",
66-
"__subclasshook__",
67-
"__weakref__",
6828
"add",
6929
"getNumber",
7030
"member1",
@@ -90,14 +50,11 @@ def add(self, x, y):
9050

9151
PyObject a = locals.GetItem("a");
9252

93-
IEnumerable<string> membernames = a.GetDynamicMemberNames();
53+
IEnumerable<string> memberNames = a.GetDynamicMemberNames();
9454

95-
Assert.AreEqual(expectedMemberNames.Count, membernames.Count(), "Unexpected number of members.");
96-
97-
IEnumerable<Tuple<string, string>> results = expectedMemberNames.Zip(membernames, (x, y) => new Tuple<string, string>(x, y));
98-
foreach (Tuple<string, string> result in results)
55+
foreach (string expectedName in expectedMemberNames)
9956
{
100-
Assert.AreEqual(result.Item1, result.Item2, "Unexpected member name.");
57+
Assert.IsTrue(memberNames.Contains(expectedName), "Could not find member '{0}'.", expectedName);
10158
}
10259
}
10360
}

0 commit comments

Comments
 (0)
0