Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable warnings as errors when testing and migrate away from deprecated import methods #130

Closed
wants to merge 7 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:
jobs:
tests:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
os: [windows-2019]
runs-on: ${{ matrix.os }}
needs: code-lint
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions pywin32-tests/test_pywintypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import faulthandler
import datetime
import time
import warnings

warnings.simplefilter("error")

from win32ctypes import pywin32
from win32ctypes.pywin32.pywintypes import error
Expand Down
11 changes: 7 additions & 4 deletions win32ctypes/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ class BackendLoader(Loader):
def __init__(self, redirect_module):
self.redirect_module = redirect_module

def load_module(self, fullname):
module = importlib.import_module(self.redirect_module)
sys.modules[fullname] = module
return module
def create_module(self, spec):
# TODO: this seems wrong, but let's see the behavior
# please do tell me the right way :]
return importlib.import_module(self.redirect_module)

def exec_module(self, module):
pass


class BackendFinder(MetaPathFinder):
Expand Down