- Notifications
You must be signed in to change notification settings - Fork749
Closed
Milestone
Description
Environment
- Pythonnet version: master/3.0
- Python version: *
- Operating System: *
- .NET Runtime: *
Details
- Describe what you were trying to get done.
Seems that sinceCollectionMixinsProvider
was added this case started failing (if key in collection.Keys:
), not sure whyCollectionMixinsProvider
is required, if this is a bug or not..
Test passes commenting outhttps://github.com/pythonnet/pythonnet/blob/master/src/runtime/InteropConfiguration.cs#L24
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
classATests{privatestaticdynamiccontainsTest;privatestaticstringtestModule=@"from clr import AddReferenceAddReference(""System"")AddReference(""Python.EmbeddingTest"")def ContainsTest(key, collection): if key in collection.Keys: return True return False";[OneTimeSetUp]publicvoidSetup(){PythonEngine.Initialize();varpyModule=PyModule.FromString("module",testModule);containsTest=pyModule.GetAttr("ContainsTest");}[TestCase("AAPL",false)][TestCase("SPY",true)]publicvoidContainsTest(stringkey,boolexpected){vardic=newDictionary<string,object>{{"SPY",newobject()}};Assert.AreEqual(expected,(bool)containsTest(key,dic));}}
Metadata
Metadata
Assignees
Labels
No labels