File tree Expand file tree Collapse file tree 9 files changed +35
-350
lines changed
Expand file tree Collapse file tree 9 files changed +35
-350
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ def initialize_options(self):
110110
111111 def finalize_options (self ):
112112 if self .dotnet_config is None :
113- self .dotnet_config = "release "
113+ self .dotnet_config = "debug "
114114
115115 build = self .distribution .get_command_obj ("build" )
116116 build .ensure_finalized ()
Original file line number Diff line number Diff line change 2626using System . IO ;
2727using System . Reflection ;
2828using System . Runtime . InteropServices ;
29+
2930using NXPorts . Attributes ;
3031
3132public class clrModule
@@ -62,9 +63,9 @@ public static IntPtr PyInit_clr()
6263 pythonRuntime = Assembly . Load ( pythonRuntimeName ) ;
6364 DebugPrint ( "Success loading 'Python.Runtime' using standard binding rules." ) ;
6465 }
65- catch ( IOException )
66+ catch ( IOException ex )
6667 {
67- DebugPrint ( "'Python.Runtime' not found using standard binding rules. " ) ;
68+ DebugPrint ( $ "'Python.Runtime' not found using standard binding rules: { ex } ") ;
6869 try
6970 {
7071 // If the above fails for any reason, we fallback to attempting to load "Python.Runtime.dll"
@@ -78,6 +79,10 @@ public static IntPtr PyInit_clr()
7879
7980 Assembly executingAssembly = Assembly . GetExecutingAssembly ( ) ;
8081 string assemblyDirectory = Path . GetDirectoryName ( executingAssembly . Location ) ;
82+ #if DEBUG
83+ string newAssemblyDirectory = Path . Combine ( assemblyDirectory , @"..\..\..\src\runtime\bin\Debug\netstandard2.0" ) ;
84+ if ( Directory . Exists ( newAssemblyDirectory ) ) assemblyDirectory = newAssemblyDirectory ;
85+ #endif
8186 if ( assemblyDirectory == null )
8287 {
8388 throw new InvalidOperationException ( executingAssembly . Location ) ;
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFrameworks >net472; netcoreapp3.1</TargetFrameworks >
4+ <TargetFrameworks >netcoreapp3.1</TargetFrameworks >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change 1+ {
2+ "profiles" : {
3+ "Python.Runtime" : {
4+ "commandName" : " Executable" ,
5+ "executablePath" : " C:\\ Users\\ minka\\ Depots\\ pythonnet\\ src\\ tests\\ Pythonnet\\ Scripts\\ python.exe" ,
6+ "commandLineArgs" : " \\ users\\ minka\\ Depots\\ pythonnet\\ src\\ tests\\ runtests.py \\ users\\ minka\\ Depots\\ pythonnet\\ src\\ tests"
7+ }
8+ }
9+ }
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
3- <TargetFrameworks >netstandard2.0</TargetFrameworks >
3+ <TargetFramework >netstandard2.0</TargetFramework >
44 <Platforms >AnyCPU</Platforms >
55 <RootNamespace >Python.Runtime</RootNamespace >
66 <AssemblyName >Python.Runtime</AssemblyName >
1717
1818 <PropertyGroup >
1919 <DefineConstants >TRACE;PYTHON37;WINDOWS</DefineConstants >
20+ <DebugType >full</DebugType >
21+ <DebugSymbols >true</DebugSymbols >
2022 </PropertyGroup >
2123
2224 <ItemGroup Condition =" '$(PythonInteropFile)' != '' " >
Original file line number Diff line number Diff line change 1111
1212import pytest
1313
14+ #if os.getenv('_PYTEST_RAISE', "0") != "0":
15+
16+ #@pytest.hookimpl(tryfirst=True)
17+ #def pytest_exception_interact(call):
18+ # raise call.excinfo.value
19+
20+ #@pytest.hookimpl(tryfirst=True)
21+ #def pytest_internalerror(excinfo):
22+ # raise excinfo.value
23+
1424# Add path for `Python.Test`
1525cwd = os .path .dirname (__file__ )
1626fixtures_path = os .path .join (cwd , "fixtures" )
Original file line number Diff line number Diff line change 1414 print ("Load clr import hook" )
1515 import clr
1616
17- clr .AddReference ("Python.Test" )
17+ # clr.AddReference("Python.Test")
1818 clr .AddReference ("System.Collections" )
1919 clr .AddReference ("System.Data" )
2020 clr .AddReference ("System.Management" )
@@ -29,6 +29,8 @@ def main(verbosity=1):
2929 # FIXME: test_engine has tests that are being skipped.
3030 # FIXME: test_subclass has tests that are being skipped.
3131 pytest .main ()
32+ print ("Done" )
33+ input ()
3234
3335
3436if __name__ == '__main__' :
Original file line number Diff line number Diff line change 2828 <VisualStudioVersion Condition =" '$(VisualStudioVersion)' == '' " >10.0</VisualStudioVersion >
2929 </PropertyGroup >
3030 <ItemGroup >
31+ <Compile Include =" conftest.py" />
3132 <Compile Include =" __init__.py" />
3233 <Compile Include =" _missing_import.py" />
3334 <Compile Include =" leaktest.py" />
You can’t perform that action at this time.
0 commit comments