]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Make call-count profiling tests on osx have their own platform key
authorFederico Caselli <cfederico87@gmail.com>
Sat, 11 Jul 2020 17:03:46 +0000 (19:03 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 11 Jul 2020 17:09:24 +0000 (19:09 +0200)
They previously would use the linux profiles, but recently some discrepancies in
the function call count on osx would make the tests fail.

Change-Id: Ifdfdca1676972de4179f59cdaae196f6805d4a21
(cherry picked from commit 2ada9686ffb86d39ea25aa146593dde2340fee03)

lib/sqlalchemy/testing/profiling.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/compat.py

index 771e931730695af1e190975bcca814d5feba91df..28ebaf08da756edff06bea0c2d597b280972478e 100644 (file)
@@ -21,6 +21,7 @@ import sys
 from . import config
 from .util import gc_collect
 from ..util import jython
+from ..util import osx
 from ..util import pypy
 from ..util import update_wrapper
 from ..util import win32
@@ -84,6 +85,8 @@ class ProfileStatsFile(object):
             platform_tokens.append("pypy")
         if win32:
             platform_tokens.append("win")
+        if osx:
+            platform_tokens.append("osx")
         platform_tokens.append(
             "nativeunicode"
             if config.db.dialect.convert_unicode
index 57c17717f2c4ecd3126919f4759e239b3e79891b..5db8d1de1aac173cb2bef4af57bae49ef404744a 100644 (file)
@@ -62,6 +62,7 @@ from .compat import jython  # noqa
 from .compat import namedtuple  # noqa
 from .compat import nested  # noqa
 from .compat import next  # noqa
+from .compat import osx  # noqa
 from .compat import parse_qsl  # noqa
 from .compat import pickle  # noqa
 from .compat import print_  # noqa
index 5609eddabbe8615bd872ac86ddb25431b75c69c8..37ce320e4ae38497759eaf428424f10dc70416bc 100644 (file)
@@ -25,6 +25,7 @@ jython = sys.platform.startswith("java")
 pypy = hasattr(sys, "pypy_version_info")
 
 win32 = sys.platform.startswith("win")
+osx = sys.platform.startswith("darwin")
 cpython = not pypy and not jython  # TODO: something better for this ?
 
 contextmanager = contextlib.contextmanager