◐ Shell
reader mode source ↗
Skip to content
Merged
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ jobs:
- name: Python Tests
run: pytest

- name: Run Embedding tests
run: dotnet test --runtime any-${{ matrix.platform }} src/embed_tests/
if: ${{ matrix.os != 'macos' }} # Not working right now, doesn't find libpython

# TODO: Run perf tests
# TODO: Run mono tests on Windows?
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ details about the cause of the failure
- Made it possible to call `ToString`, `GetHashCode`, and `GetType` on inteface objects
- Fixed objects returned by enumerating `PyObject` being disposed too soon
- Incorrectly using a non-generic type with type parameters now produces a helpful Python error instead of throwing NullReferenceException

### Removed

Expand Down
25 changes: 25 additions & 0 deletions src/python_tests_runner/Python.PythonTestsRunner.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
82 changes: 82 additions & 0 deletions src/python_tests_runner/PythonTestRunner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
4 changes: 3 additions & 1 deletion src/runtime/importhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
// We don't support them anyway
return IntPtr.Zero;
}
// Otherwise, just clear the it.
Exceptions.Clear();

Expand Down Expand Up @@ -342,7 +344,7 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
ManagedType mt = tail.GetAttribute(name, true);
if (!(mt is ModuleObject))
{
Exceptions.SetError(Exceptions.ImportError, $"No module named {name}");
return IntPtr.Zero;
}
if (head == null)
Expand Down
Toggle all file notes Toggle all file annotations