This repository was archived by the owner on Apr 14, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33using System . Text ;
44using System . Threading . Tasks ;
55using Microsoft . Python . LanguageServer . Implementation ;
6+ using Microsoft . PythonTools . Analysis ;
67using Microsoft . PythonTools . Analysis . FluentAssertions ;
78using Microsoft . PythonTools . Interpreter ;
89using Microsoft . VisualStudio . TestTools . UnitTesting ;
910using TestUtilities ;
1011
11- namespace Microsoft . PythonTools . Analysis {
12+ namespace AnalysisTests {
1213 [ TestClass ]
1314 public class InheritanceTests {
1415 public TestContext TestContext { get ; set ; }
@@ -38,5 +39,30 @@ def virt():
3839 analysis . Should ( ) . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Int ) ;
3940 }
4041 }
42+
43+ [ TestMethod ]
44+ public async Task AbstractPropertyReturnTypeIgnored ( ) {
45+ var code = @"
46+ import abc
47+
48+ class A:
49+ @abc.abstractproperty
50+ def virt():
51+ pass
52+
53+ class B(A):
54+ @property
55+ def virt():
56+ return 42
57+
58+ a = A()
59+ b = a.virt" ;
60+
61+ using ( var server = await new Server ( ) . InitializeAsync ( PythonVersions . Required_Python36X ) ) {
62+ var analysis = await server . OpenDefaultDocumentAndGetAnalysisAsync ( code ) ;
63+
64+ analysis . Should ( ) . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Int ) ;
65+ }
66+ }
4167 }
4268}
Original file line number Diff line number Diff line change 11<Project >
22 <PropertyGroup >
33 <TargetFramework >netcoreapp2.1</TargetFramework >
4- <RootNamespace >Microsoft.PythonTools.Analysis </RootNamespace >
4+ <RootNamespace >AnalysisTests </RootNamespace >
55 <AssemblyName >Microsoft.Python.Analysis.Engine.Tests</AssemblyName >
66 </PropertyGroup >
77 <PropertyGroup >
You can’t perform that action at this time.
0 commit comments