Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 010a67e

Browse files
committed
added test for #312
1 parent 66e336b commit 010a67e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Analysis/Engine/Test/InheritanceTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@ def virt():
6060
analysis.Should().HaveVariable("b").OfTypes(BuiltinTypeId.Int, BuiltinTypeId.Function);
6161
}
6262

63+
64+
[TestMethod]
65+
public async Task NewInheritedFromNamedTuple() {
66+
var code = @"
67+
import collections
68+
69+
class A(collections.namedtuple('A', [])):
70+
def __new__(cls):
71+
return super(A, cls).__new__(cls)
72+
73+
a = A()";
74+
75+
using (var server = await new Server().InitializeAsync(PythonVersions.Required_Python36X)) {
76+
var analysis = await server.OpenDefaultDocumentAndGetAnalysisAsync(code);
77+
78+
analysis.Should().HaveVariable("a").OfType(className: "A");
79+
}
80+
}
81+
6382
[ServerTestMethod(Version = PythonLanguageVersion.V36), Priority(0)]
6483
public async Task ParameterTypesPropagateToDerivedFunctions(Server server) {
6584
var code = @"

0 commit comments

Comments
 (0)