- "3.6"
- "3.7"
- "3.8"
+ - "pypy3"
build-type:
- "cext"
- "nocext"
- os: "windows-latest"
python-version: "2.7"
pytest-args: "-k 'not MockReconnectTest and not test_hanging_connect_within_overflow'"
+ # autocommit tests fail on the ci for some reason
+ - python-version: "pypy3"
+ pytest-args: "-k 'not test_autocommit_on and not test_turn_autocommit_off_via_default_iso_level and not test_autocommit_isolation_level'"
exclude:
# c-extensions fail to build on windows for python 3.5 and 2.7
architecture: x86
- os: "macos-latest"
architecture: x86
+ # pypy does not have cext
+ - python-version: "pypy3"
+ build-type: "cext"
+ # pypy on windows has an ancient sqlite version (3.6)
+ - os: "windows-latest"
+ python-version: "pypy3"
fail-fast: false
if key == "__init__" and hasattr(method, "_sa_original_init"):
method = method._sa_original_init
if isinstance(method, types.MethodType):
- method = method.im_func
+ method = method.__func__
if isinstance(method, types.FunctionType):
if hasattr(method, "__sa_reconstructor__"):
self._reconstructor = method
code, {"target": target, "fn": fn}, fn.__name__
)
if not add_positional_parameters:
- decorated.__defaults__ = getattr(fn, "im_func", fn).__defaults__
+ decorated.__defaults__ = getattr(fn, "__func__", fn).__defaults__
decorated.__wrapped__ = fn
return update_wrapper(decorated, fn)
else:
from .compat import py36 # noqa
from .compat import py37 # noqa
from .compat import py3k # noqa
+from .compat import pypy # noqa
from .compat import quote_plus # noqa
from .compat import raise_ # noqa
from .compat import raise_from_cause # noqa
py36 = sys.version_info >= (3, 6)
py3k = sys.version_info >= (3, 0)
py2k = sys.version_info < (3, 0)
+pypy = hasattr(sys, "pypy_version_info")
cpython = platform.python_implementation() == "CPython"
env.update({targ_name: target, fn_name: fn})
decorated = _exec_code_in_env(code, env, fn.__name__)
- decorated.__defaults__ = getattr(fn, "im_func", fn).__defaults__
+ decorated.__defaults__ = getattr(fn, "__func__", fn).__defaults__
decorated.__wrapped__ = fn
return update_wrapper(decorated, fn)
fn = getattr(from_cls, method)
if not hasattr(fn, "__call__"):
continue
- fn = getattr(fn, "im_func", fn)
+ fn = getattr(fn, "__func__", fn)
except AttributeError:
continue
try:
lambda: my_functools_default(), my_functools_default
)
eq_(c.__name__, "partial")
- eq_(c.__doc__, my_functools_default.__call__.__doc__)
+ if not compat.pypy: # pypy fails this check
+ eq_(c.__doc__, my_functools_default.__call__.__doc__)
eq_(c(), 5)
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
+from sqlalchemy import testing
from sqlalchemy import util
from sqlalchemy.sql import util as sql_util
from sqlalchemy.testing import assert_raises
q = self._stpool_logging_fixture()
self._test_queuepool(q, False)
+ @testing.requires.predictable_gc
def test_queuepool_echo(self):
q = self._queuepool_echo_fixture()
self._test_queuepool(q)
+ @testing.requires.predictable_gc
def test_queuepool_logging(self):
q = self._queuepool_logging_fixture()
self._test_queuepool(q)
assert canary.call_args_list[0][0][0] is dbapi_con
assert canary.call_args_list[0][0][2] is exc
+ @testing.requires.predictable_gc
def test_checkin_event_gc(self):
p, canary = self._checkin_event_fixture()
c1 = s.query(C).order_by(C.id)
eq_(c1.all(), [C(c_expr=1), C(c_expr=1)])
+ s.expunge_all()
+
c2 = (
s.query(C)
.options(with_expression(C.c_expr, C.x * 2))