"""
import os, sys
+from sqlalchemy.test import config
from sqlalchemy.test.util import function_named, gc_collect
-import config
+from nose import SkipTest
__all__ = 'profiled', 'function_call_count', 'conditional_call_count'
def _profile(filename, fn, *args, **kw):
global profiler
if not profiler:
- profiler = 'hotshot'
if sys.version_info > (2, 5):
try:
import cProfile
profiler = 'cProfile'
except ImportError:
pass
+ if not profiler:
+ try:
+ import hotshot
+ profiler = 'hotshot'
+ except ImportError:
+ profiler = 'skip'
- if profiler == 'cProfile':
+ if profiler == 'skip':
+ raise SkipTest('Profiling not supported on this platform')
+ elif profiler == 'cProfile':
return _profile_cProfile(filename, fn, *args, **kw)
else:
return _profile_hotshot(filename, fn, *args, **kw)
from sqlalchemy.orm import mapper, relation, create_session, clear_mappers, sessionmaker
from sqlalchemy.orm.mapper import _mapper_registry
from sqlalchemy.orm.session import _sessions
+from sqlalchemy.util import jython
import operator
from sqlalchemy.test import testing
from sqlalchemy import MetaData, Integer, String, ForeignKey, PickleType
import gc
from test.orm import _base
+if jython:
+ from nose import SkipTest
+ raise SkipTest("Profiling not supported on this platform")
+
class A(_base.ComparableEntity):
pass
class MemUsageTest(EnsureZeroed):
# ensure a pure growing test trips the assertion
- @testing.fails_if(lambda:True)
+ @testing.fails_if(lambda: True)
def test_fixture(self):
class Foo(object):
pass