Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r90642:87e9652421d1 Date: 2017-03-13 07:45 +0100 http://bitbucket.org/pypy/pypy/changeset/87e9652421d1/
Log: Skip test in -A diff --git a/pypy/module/cpyext/test/test_object.py b/pypy/module/cpyext/test/test_object.py --- a/pypy/module/cpyext/test/test_object.py +++ b/pypy/module/cpyext/test/test_object.py @@ -224,22 +224,27 @@ else: cls.w_tmpname = cls.space.wrap(tmpname) - cls.total_mem = 0 - def add_memory_pressure(estimate): - assert estimate >= 0 - cls.total_mem += estimate - cls.orig_add_memory_pressure = [rgc.add_memory_pressure] - rgc.add_memory_pressure = add_memory_pressure + if not cls.runappdirect: + cls.total_mem = 0 + def add_memory_pressure(estimate): + assert estimate >= 0 + cls.total_mem += estimate + cls.orig_add_memory_pressure = [rgc.add_memory_pressure] + rgc.add_memory_pressure = add_memory_pressure - def _reset_memory_pressure(space): - cls.total_mem = 0 - cls.w_reset_memory_pressure = cls.space.wrap( - gateway.interp2app(_reset_memory_pressure)) + def _reset_memory_pressure(space): + cls.total_mem = 0 + cls.w_reset_memory_pressure = cls.space.wrap( + gateway.interp2app(_reset_memory_pressure)) - def _cur_memory_pressure(space): - return space.newint(cls.total_mem) - cls.w_cur_memory_pressure = cls.space.wrap( - gateway.interp2app(_cur_memory_pressure)) + def _cur_memory_pressure(space): + return space.newint(cls.total_mem) + cls.w_cur_memory_pressure = cls.space.wrap( + gateway.interp2app(_cur_memory_pressure)) + else: + def _skip_test(*ignored): + pytest.skip("not for -A testing") + cls.w_reset_memory_pressure = _skip_test def teardown_class(cls): from rpython.rlib import rgc @@ -349,6 +354,7 @@ assert isinstance(a, unicode) def test_add_memory_pressure(self): + self.reset_memory_pressure() # for the potential skip module = self.import_extension('foo', [ ("foo", "METH_O", """ _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit