Skip to content

Commit

Permalink
adapt tests to pypy
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Aug 24, 2021
1 parent 3ef27fb commit 90de2cb
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions recipe/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
_winxptheme: private module
wincerapi: interface to the win32 CE Remote API
"""
import os
import sys

IS_PYPY = sys.implementation.name == 'pypy'

import mmapfile
import odbc
import perfmon
import pywintypes
import servicemanager
import timer
import win2kras
import win32api
Expand All @@ -37,15 +41,24 @@
import win32service
import win32transaction
import win32ts
import win32ui
import win32wnet

import os
if IS_PYPY:
try:
import servicemanager
import win32ui
except ImportError:
pass
else:
raise ImportError('sucesssfully imported module that should not be importable')
else:
import servicemanager
import win32ui

conda_py = str(os.sys.version_info.major) + str(os.sys.version_info.minor)

pythoncom_filename = os.environ["LIBRARY_BIN"] + "\pythoncom" + conda_py + ".dll"
pywintypes_filename = os.environ["LIBRARY_BIN"] + "\pywintypes" + conda_py + ".dll"

assert os.path.isfile(pythoncom_filename)
if not IS_PYPY:
assert os.path.isfile(pythoncom_filename)
assert os.path.isfile(pywintypes_filename)

0 comments on commit 90de2cb

Please sign in to comment.