Skip to content
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
Next Next commit
Fixing unit test
  • Loading branch information
John Wilkes committed Jun 17, 2018
commit 23aef26fd5754c68e10a1377004a21f436305730
16 changes: 15 additions & 1 deletion src/embed_tests/TestPyObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,34 @@ public void TestGetDynamicMemberNames()
"__class__",
"__delattr__",
"__dict__",
#if PYTHON3
"__dir__",
#endif
"__doc__",
#if PYTHON3
"__eq__",
#endif
"__format__",
#if PYTHON3
"__ge__",
#endif
"__getattribute__",
#if PYTHON3
"__gt__",
#endif
"__hash__",
"__init__",
#if PYTHON36
"__init_subclass__",
#endif
#if PYTHON3
"__le__",
"__lt__",
#endif
"__module__",
#if PYTHON3
"__ne__",
#endif
"__new__",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defines here make the whole thing quite brittle, I think, to me it would be perfectly fine to just check that the explicitly added members exist (i.e. add, getNumber etc.).

"__reduce__",
"__reduce_ex__",
Expand All @@ -60,7 +74,7 @@ public void TestGetDynamicMemberNames()
PyDict locals = new PyDict();

PythonEngine.Exec(@"
class MemberNamesTest:
class MemberNamesTest(object):
def __init__(self):
self.member1 = 123
self.member2 = 'Test string'
Expand Down