From 46ee78431c81d25ad38b76639ff91f76a5873573 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 23 Apr 2011 12:34:38 -0700 Subject: [PATCH] mark all aaa_profiling tests with __requires__ = 'cpython', --- test/aaa_profiling/test_compiler.py | 2 ++ test/aaa_profiling/test_memusage.py | 8 ++------ test/aaa_profiling/test_orm.py | 4 +++- test/aaa_profiling/test_pool.py | 2 ++ test/aaa_profiling/test_resultset.py | 3 ++- test/lib/requires.py | 8 ++++++++ 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/test/aaa_profiling/test_compiler.py b/test/aaa_profiling/test_compiler.py index f68e82b073..f949ce6ead 100644 --- a/test/aaa_profiling/test_compiler.py +++ b/test/aaa_profiling/test_compiler.py @@ -3,6 +3,8 @@ from test.lib import * from sqlalchemy.engine import default class CompileTest(fixtures.TestBase, AssertsExecutionResults): + __requires__ = 'cpython', + @classmethod def setup_class(cls): diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py index 80939376ca..0cbe126b43 100644 --- a/test/aaa_profiling/test_memusage.py +++ b/test/aaa_profiling/test_memusage.py @@ -3,7 +3,6 @@ from sqlalchemy.orm import mapper, relationship, create_session, \ clear_mappers, sessionmaker, class_mapper from sqlalchemy.orm.mapper import _mapper_registry from sqlalchemy.orm.session import _sessions -from sqlalchemy.util import jython import operator from test.lib import testing, engines from sqlalchemy import MetaData, Integer, String, ForeignKey, \ @@ -19,11 +18,6 @@ import gc import weakref from test.lib import fixtures -if jython: - from nose import SkipTest - raise SkipTest("Profiling not supported on this platform") - - class A(fixtures.ComparableEntity): pass class B(fixtures.ComparableEntity): @@ -75,6 +69,8 @@ class EnsureZeroed(fixtures.ORMTest): class MemUsageTest(EnsureZeroed): + __requires__ = 'cpython', + # ensure a pure growing test trips the assertion @testing.fails_if(lambda: True) def test_fixture(self): diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index 25e84b9f3d..24a687f1c3 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -10,6 +10,8 @@ import sys class MergeTest(fixtures.MappedTest): + __requires__ = 'cpython', + @classmethod def define_tables(cls, metadata): parent = Table('parent', metadata, Column('id', Integer, @@ -115,7 +117,7 @@ class LoadManyToOneFromIdentityTest(fixtures.MappedTest): # count here, # so remove some platforms that have wildly divergent # callcounts. - __requires__ = 'python25', + __requires__ = 'python25', 'cpython' __unsupported_on__ = 'postgresql+pg8000', 'mysql+pymysql' @classmethod diff --git a/test/aaa_profiling/test_pool.py b/test/aaa_profiling/test_pool.py index 35f6b71f93..1077a78b7c 100644 --- a/test/aaa_profiling/test_pool.py +++ b/test/aaa_profiling/test_pool.py @@ -4,6 +4,8 @@ from sqlalchemy.pool import QueuePool from sqlalchemy import pool as pool_module class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults): + __requires__ = 'cpython', + class Connection(object): def rollback(self): pass diff --git a/test/aaa_profiling/test_resultset.py b/test/aaa_profiling/test_resultset.py index 9ba3d69175..e2c6ecd500 100644 --- a/test/aaa_profiling/test_resultset.py +++ b/test/aaa_profiling/test_resultset.py @@ -5,7 +5,7 @@ NUM_RECORDS = 1000 class ResultSetTest(fixtures.TestBase, AssertsExecutionResults): - + __requires__ = 'cpython', __only_on__ = 'sqlite' @classmethod @@ -53,6 +53,7 @@ class ResultSetTest(fixtures.TestBase, AssertsExecutionResults): [tuple(row) for row in t2.select().execute().fetchall()] class ExecutionTest(fixtures.TestBase): + __requires__ = 'cpython', __only_on__ = 'sqlite' def test_minimal_connection_execute(self): diff --git a/test/lib/requires.py b/test/lib/requires.py index 5f3eb1c9ac..44ba6ffac2 100644 --- a/test/lib/requires.py +++ b/test/lib/requires.py @@ -346,6 +346,14 @@ def python25(fn): ) ) +def cpython(fn): + return _chain_decorators_on( + fn, + skip_if(lambda: util.jython or util.pypy, + "cPython interpreter needed" + ) + ) + def _has_cextensions(): try: from sqlalchemy import cresultproxy, cprocessors -- 2.39.5