Maciej Fijalkowski avatar Maciej Fijalkowski committed 6fb576a

fix config tests

Comments (0)

Files changed (8)


-    BoolOption("nofaking", "disallow faking in the object space",
-               default=False,
-               requires=[
-                   ("objspace.usemodules.posix", True),
-                   ("objspace.usemodules.time", True),
-                   ("objspace.usemodules.errno", True)],
-               cmdline='--nofaking'),
     OptionDescription("usemodules", "Which Modules should be used", [
         BoolOption(modname, "use module %s" % (modname, ),
                    default=modname in default_modules,


     assert '_cfgimpl_values' in attrs # from self
     if sys.version_info >= (2, 6):
         assert 'gc' in attrs              # custom attribute
-        assert 'objspace' in attrs        # custom attribute
     attrs = dir(config.gc)
     if sys.version_info >= (2, 6):
     config = Config(descr)
     assert config.getpaths() == ['', 'gc.dummy', 'gc.float', 'bool',
-                                 'objspace', 'wantref', 'str', 'wantframework',
+                                 'wantref', 'str', 'wantframework',
     assert config.getpaths() == descr.getpaths()
     assert config.gc.getpaths() == ['name', 'dummy', 'float']
     assert config.gc.getpaths() == descr.gc.getpaths()
     assert config.getpaths(include_groups=True) == [
         'gc', '', 'gc.dummy', 'gc.float',
-        'bool', 'objspace', 'wantref', 'str', 'wantframework', 'int']
+        'bool', 'wantref', 'str', 'wantframework', 'int']
     assert config.getpaths(True) == descr.getpaths(True)
 def test_underscore_in_option_name():


         if 'rctime' in modules and 'time' in modules:
-        if not self.config.objspace.nofaking:
-            for modname in self.ALL_BUILTIN_MODULES:
-                if not LIB_PYPY.join(modname+'.py').check(file=True):
-                    modules.append('faked+'+modname)
         self._builtinmodule_list = modules
         return self._builtinmodule_list


 config = get_pypy_config(translating=True)
 config.translation.backendopt.inline_threshold = 0.1
 config.translation.gc = 'boehm'
-config.objspace.nofaking = True
 config.translating = True
 set_opt_level(config, level='jit')
 config.objspace.allworkingmodules = False


         ec._py_repr = None
         return ec
-    def createframe(self, code, w_globals, outer_func=None):
-        from pypy.objspace.std.fake import CPythonFakeCode, CPythonFakeFrame
-        if not we_are_translated() and isinstance(code, CPythonFakeCode):
-            return CPythonFakeFrame(self, code, w_globals)
-        else:
-            return ObjSpace.createframe(self, code, w_globals, outer_func)
     def gettypefor(self, cls):
         return self.gettypeobject(cls.typedef)
             # '__builtin__.Ellipsis' avoids confusion with special.Ellipsis
             return self.w_Ellipsis
-        if self.config.objspace.nofaking:
-            raise OperationError(self.w_RuntimeError,
-                                 self.wrap("nofaking enabled: refusing "
-                                           "to wrap cpython value %r" %(x,)))
         if isinstance(x, type(Exception)) and issubclass(x, Exception):
             w_result = self.wrap_exception_cls(x)
             if w_result is not None:


 EPS = 1e-9
 class TestW_ComplexObject:
     def test_instantiation(self):
         def _t_complex(r=0.0,i=0.0):
             c = W_ComplexObject(r, i)
 class AppTestAppComplexTest:
+    spaceconfig = dict(usemodules=['binascii', 'rctime'])
     def w_check_div(self, x, y):
         """Compute complex z=x*y, and check that z/x==y and z/y==x."""
         z = x * y


 class AppTestAppFloatTest:
+    spaceconfig = dict(usemodules=['binascii', 'rctime'])
     def setup_class(cls):
         cls.w_py26 = >= (2, 6))
             assert False, 'did not raise'
 class AppTestFloatHex:
+    spaceconfig = dict(usemodules=['binascii', 'rctime'])
     def w_identical(self, x, y):
         import math
         # check that floats x and y are identical, or that both


             config.objspace.lonepycfiles = False
             config.objspace.usepycfiles = False
-        config.objspace.nofaking = True
         config.translating = True
         import translate
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.