]> 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:10:26 +0000 (19:10 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 11 Jul 2020 17:10:26 +0000 (19:10 +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

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

index c50ce1e1537f11b53075b105b3703327c3461325..c7ccf46880f031d77437127de30b962fe2a6a79c 100644 (file)
@@ -23,6 +23,7 @@ import sys
 from . import config
 from .util import gc_collect
 from ..util import cpython
+from ..util import osx
 from ..util import win32
 
 
@@ -106,6 +107,8 @@ class ProfileStatsFile(object):
 
         if win32:
             platform_tokens.append("win")
+        if osx:
+            platform_tokens.append("osx")
         platform_tokens.append(
             "nativeunicode"
             if config.db.dialect.convert_unicode
index b2407ea18d89727a5e12d8dde6e114cc632e146e..cea9c4f667d95eea348fb70942aaca14e0bf5f1c 100644 (file)
@@ -60,6 +60,7 @@ from .compat import itertools_filter  # noqa
 from .compat import itertools_filterfalse  # noqa
 from .compat import namedtuple  # noqa
 from .compat import next  # noqa
+from .compat import osx  # noqa
 from .compat import parse_qsl  # noqa
 from .compat import perf_counter  # noqa
 from .compat import pickle  # noqa
index 806ef8ae18249f1f4f957ecdaca738eaf9b3f7a2..88e3c1640b7ea47bfd5de364b7faca33e4dbc805 100644 (file)
@@ -23,6 +23,7 @@ py2k = sys.version_info < (3, 0)
 
 cpython = platform.python_implementation() == "CPython"
 win32 = sys.platform.startswith("win")
+osx = sys.platform.startswith("darwin")
 
 has_refcount_gc = bool(cpython)