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

Commit 3fb9d77

Browse files
author
Mikhail Arkhipov
authored
Merge pull request #185 from MikhailArkhipov/tests
Fix AbstractPropertyReturnTypeIgnored test
2 parents aaef67e + daf7265 commit 3fb9d77

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/Analysis/Engine/Impl/Values/BoundMethodInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] a
4646
public override IPythonProjectEntry DeclaringModule => Function.DeclaringModule;
4747
public override int DeclaringVersion => Function.DeclaringVersion;
4848
public override IEnumerable<ILocationInfo> Locations => Function.Locations;
49+
public override BuiltinTypeId TypeId => BuiltinTypeId.Function;
4950

5051
public IEnumerable<KeyValuePair<string, string>> GetRichDescription() {
5152
if (Push()) {

src/Analysis/Engine/Impl/Values/BuiltinMethodInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public override string Documentation {
9898
return _doc;
9999
}
100100
}
101-
101+
public override BuiltinTypeId TypeId => BuiltinTypeId.BuiltinFunction;
102102
public override PythonMemberType MemberType => _memberType;
103103
public override string Name => _function.Name;
104104
public override ILocatedMember GetLocatedMember() => _function as ILocatedMember;

src/Analysis/Engine/Test/AnalysisTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,9 @@ def __invert__(self):
24252425

24262426

24272427
[TestMethod, Priority(0)]
2428-
public async Task TrueDividePython3X() {
2428+
[DataRow(PythonLanguageVersion.V35)]
2429+
[DataRow(PythonLanguageVersion.V36)]
2430+
public async Task TrueDividePython3X(PythonLanguageVersion version) {
24292431
var text = @"
24302432
class C:
24312433
def __truediv__(self, other):
@@ -2438,7 +2440,7 @@ def __rtruediv__(self, other):
24382440
c = 'abc' / a
24392441
";
24402442

2441-
using (var server = await CreateServerAsync(PythonVersions.Required_Python35X)) {
2443+
using (var server = await CreateServerAsync(PythonVersions.GetRequiredCPythonConfiguration(version))) {
24422444
var analysis = await server.OpenDefaultDocumentAndGetAnalysisAsync(text);
24432445
analysis.Should().HaveVariable("b").OfType(BuiltinTypeId.Int)
24442446
.And.HaveVariable("c").OfType(BuiltinTypeId.Float);

src/Analysis/Engine/Test/InheritanceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def virt():
3636
using (var server = await new Server().InitializeAsync(PythonVersions.Required_Python36X)) {
3737
var analysis = await server.OpenDefaultDocumentAndGetAnalysisAsync(code);
3838

39-
analysis.Should().HaveVariable("b").OfType(BuiltinTypeId.Int);
39+
analysis.Should().HaveVariable("b").OfTypes(BuiltinTypeId.Int);
4040
}
4141
}
4242

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

64-
analysis.Should().HaveVariable("b").OfType(BuiltinTypeId.Int);
64+
analysis.Should().HaveVariable("b").OfTypes(BuiltinTypeId.Int, BuiltinTypeId.Function);
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)