Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Do 'import os' less hackishly in test_cpyext.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rlamy committed Apr 28, 2016
1 parent 569aec2 commit 8362fef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pypy/module/cpyext/test/test_cpyext.py
Expand Up @@ -254,13 +254,15 @@ def test_dllhandle(self):
class AppTestCpythonExtensionBase(LeakCheckingTest):

def setup_class(cls):
cls.space.getbuiltinmodule("cpyext")
from pypy.module.imp.importing import importhook
importhook(cls.space, "os") # warm up reference counts
space = cls.space
space.getbuiltinmodule("cpyext")
# 'import os' to warm up reference counts
w_import = space.builtin.getdictvalue(space, '__import__')
space.call_function(w_import, space.wrap("os"))
#state = cls.space.fromcache(RefcountState) ZZZ
#state.non_heaptypes_w[:] = []
if not cls.runappdirect:
cls.w_runappdirect = cls.space.wrap(cls.runappdirect)
cls.w_runappdirect = space.wrap(cls.runappdirect)

def setup_method(self, func):
@gateway.unwrap_spec(name=str)
Expand Down

0 comments on commit 8362fef

Please sign in to comment.