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

Fix AbstractPropertyReturnTypeIgnored test #185

Merged
merged 3 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/Analysis/Engine/Impl/Values/BoundMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] a
public override IPythonProjectEntry DeclaringModule => Function.DeclaringModule;
public override int DeclaringVersion => Function.DeclaringVersion;
public override IEnumerable<ILocationInfo> Locations => Function.Locations;
public override BuiltinTypeId TypeId => BuiltinTypeId.Function;

public IEnumerable<KeyValuePair<string, string>> GetRichDescription() {
if (Push()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Analysis/Engine/Impl/Values/BuiltinMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public override string Documentation {
return _doc;
}
}

public override BuiltinTypeId TypeId => BuiltinTypeId.BuiltinFunction;
public override PythonMemberType MemberType => _memberType;
public override string Name => _function.Name;
public override ILocatedMember GetLocatedMember() => _function as ILocatedMember;
Expand Down
6 changes: 4 additions & 2 deletions src/Analysis/Engine/Test/AnalysisTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,9 @@ def __invert__(self):


[TestMethod, Priority(0)]
public async Task TrueDividePython3X() {
[DataRow(PythonLanguageVersion.V35)]
[DataRow(PythonLanguageVersion.V36)]
public async Task TrueDividePython3X(PythonLanguageVersion version) {
var text = @"
class C:
def __truediv__(self, other):
Expand All @@ -2438,7 +2440,7 @@ def __rtruediv__(self, other):
c = 'abc' / a
";

using (var server = await CreateServerAsync(PythonVersions.Required_Python35X)) {
using (var server = await CreateServerAsync(PythonVersions.GetRequiredCPythonConfiguration(version))) {
var analysis = await server.OpenDefaultDocumentAndGetAnalysisAsync(text);
analysis.Should().HaveVariable("b").OfType(BuiltinTypeId.Int)
.And.HaveVariable("c").OfType(BuiltinTypeId.Float);
Expand Down
4 changes: 2 additions & 2 deletions src/Analysis/Engine/Test/InheritanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def virt():
using (var server = await new Server().InitializeAsync(PythonVersions.Required_Python36X)) {
var analysis = await server.OpenDefaultDocumentAndGetAnalysisAsync(code);

analysis.Should().HaveVariable("b").OfType(BuiltinTypeId.Int);
analysis.Should().HaveVariable("b").OfTypes(BuiltinTypeId.Int);
}
}

Expand All @@ -61,7 +61,7 @@ def virt():
using (var server = await new Server().InitializeAsync(PythonVersions.Required_Python36X)) {
var analysis = await server.OpenDefaultDocumentAndGetAnalysisAsync(code);

analysis.Should().HaveVariable("b").OfType(BuiltinTypeId.Int);
analysis.Should().HaveVariable("b").OfTypes(BuiltinTypeId.Int, BuiltinTypeId.Function);
}
}
}
Expand Down