Commits

Ronny Pfannschmidt committed 878303a

kill usage of the option from pypy.conftest

Comments (0)

Files changed (14)

pypy/interpreter/test/test_pyframe.py

 from rpython.tool import udir
-from pypy.conftest import option
 
+import py
 
 class AppTestPyFrame:
 
     def setup_class(cls):
         cls.w_udir = cls.space.wrap(str(udir.udir))
         cls.w_tempfile1 = cls.space.wrap(str(udir.udir.join('tempfile1')))
-        if not option.runappdirect:
+        if not py.test.config.option.runappdirect:
             w_call_further = cls.space.appexec([], """():
                 def call_further(f):
                     return f()

pypy/module/_continuation/test/test_translated.py

 class AppTestWrapper:
     def setup_class(cls):
         "Run test_various_depths() when we are run with 'pypy py.test -A'."
-        from pypy.conftest import option
-        if not option.runappdirect:
+        if not py.test.config.option.runappdirect:
             py.test.skip("meant only for -A run")
 
 def _setup():

pypy/module/gc/test/test_referents.py

-from pypy.conftest import option
-
+import py
 
 class AppTestReferents(object):
 
         cls.w_ALL_ROOTS = cls.space.newlist(cls.ALL_ROOTS)
         rgc.get_rpy_roots = lambda: (
             map(rgc._GcRef, cls.ALL_ROOTS) + [rgc.NULL_GCREF]*17)
-        cls.w_runappdirect = cls.space.wrap(option.runappdirect)
+        cls.w_runappdirect = cls.space.wrap(py.test.config.option.runappdirect)
 
     def teardown_class(cls):
         from rpython.rlib import rgc

pypy/module/micronumpy/test/test_base.py

         find_unaryop_result_dtype)
 from pypy.module.micronumpy.interp_dtype import nonnative_byteorder_prefix,\
      byteorder_prefix
-from pypy.conftest import option
 import sys
+import py
 
 class BaseNumpyAppTest(object):
     spaceconfig = dict(usemodules=['micronumpy'])
 
     @classmethod
     def setup_class(cls):
-        if option.runappdirect:
+        if py.test.config.option.runappdirect:
             if '__pypy__' not in sys.builtin_module_names:
                 import numpy
                 sys.modules['numpypy'] = numpy

pypy/module/micronumpy/test/test_complex.py

 
 import sys
 
-from pypy.conftest import option
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import interp2app
 from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest
 class AppTestUfuncs(BaseNumpyAppTest):
     def setup_class(cls):
         import os
+        import py
         BaseNumpyAppTest.setup_class.im_func(cls)
         fname128 = os.path.join(os.path.dirname(__file__), 'complex_testcases.txt')
         fname64 = os.path.join(os.path.dirname(__file__), 'complex64_testcases.txt')
         cls.w_testcases128 = cls.space.wrap(list(parse_testfile(fname128)))
         cls.w_testcases64 = cls.space.wrap(list(parse_testfile(fname64)))
 
-        cls.w_runAppDirect = cls.space.wrap(option.runappdirect)
+        cls.w_runAppDirect = cls.space.wrap(py.test.config.option.runappdirect)
         cls.w_isWindows = cls.space.wrap(os.name == 'nt')
 
         if cls.runappdirect:

pypy/module/micronumpy/test/test_dtypes.py

 import py, sys
-from pypy.conftest import option
 from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest
 from pypy.interpreter.gateway import interp2app
 
 class AppTestTypes(BaseNumpyAppTest):
     def setup_class(cls):
         BaseNumpyAppTest.setup_class.im_func(cls)
-        if option.runappdirect:
+        if py.test.config.option.runappdirect:
             import platform
             bits, linkage = platform.architecture()
             ptr_size = int(bits[:-3]) // 8

pypy/module/micronumpy/test/test_numarray.py

 
 import py, sys
 
-from pypy.conftest import option
 from pypy.module.micronumpy.appbridge import get_appbridge_cache
 from pypy.module.micronumpy.iter import Chunk, Chunks
 from pypy.module.micronumpy.interp_numarray import W_NDimArray
 
 class AppTestRepr(BaseNumpyAppTest):
     def setup_class(cls):
-        if option.runappdirect:
+        if py.test.config.option.runappdirect:
             py.test.skip("Can't be run directly.")
         BaseNumpyAppTest.setup_class.im_func(cls)
         cache = get_appbridge_cache(cls.space)
         assert str(array([1, 2, 3])) == 'array([1, 2, 3])'
 
     def teardown_class(cls):
-        if option.runappdirect:
+        if py.test.config.option.runappdirect:
             return
         cache = get_appbridge_cache(cls.space)
         cache.w_array_repr = cls.old_array_repr
        
 class AppTestPyPy(BaseNumpyAppTest):
     def setup_class(cls):
-        if option.runappdirect and '__pypy__' not in sys.builtin_module_names:
+        if py.test.config.option.runappdirect and \
+           '__pypy__' not in sys.builtin_module_names:
             py.test.skip("pypy only test")
         BaseNumpyAppTest.setup_class.im_func(cls)
     

pypy/module/micronumpy/test/test_ufuncs.py

-from pypy.conftest import option
+import py
 from pypy.interpreter.gateway import interp2app
 from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest
 from rpython.rlib.rcomplex import c_pow
         def cls_c_pow(space, args_w):
             return space.wrap(c_pow(*map(space.unwrap, args_w)))
         cls.w_c_pow = cls.space.wrap(interp2app(cls_c_pow))
-        cls.w_runAppDirect = cls.space.wrap(option.runappdirect)
+        cls.w_runAppDirect = cls.space.wrap(py.test.config.option.runappdirect)
         cls.w_isWindows = cls.space.wrap(os.name == 'nt')
 
     def test_ufunc_instance(self):

pypy/module/oracle/roci.py

 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.rtyper.tool import rffi_platform as platform
 from rpython.rtyper.lltypesystem import rffi, lltype
-from pypy.conftest import option
 import sys, os
 import py
 
-oracle_home = getattr(option, 'oracle_home',
+oracle_home = getattr(py.test.config.option, 'oracle_home',
                       os.environ.get("ORACLE_HOME"))
 if oracle_home:
     ORACLE_HOME = py.path.local(oracle_home)

pypy/module/oracle/test/test_connect.py

-from pypy.conftest import option
 from rpython.rtyper.tool.rffi_platform import CompilationError
 import py
 
         space = cls.space
         space.setitem(space.builtin.w_dict, space.wrap('oracle'),
                       space.getbuiltinmodule('cx_Oracle'))
-        oracle_connect = option.oracle_connect
+        oracle_connect = py.test.config.option.oracle_connect
         if not oracle_connect:
             py.test.skip(
                 "Please set --oracle-connect to a valid connect string")

pypy/objspace/std/test/test_obj.py

 from __future__ import with_statement
-from pypy.conftest import option
-
+import py
 class AppTestObject:
 
     def setup_class(cls):
         from pypy.interpreter import gateway
         import sys
 
-        cpython_behavior = (not option.runappdirect
+        runappdirect = py.test.config.option.runappdirect
+        cpython_behavior = (not runappdirect
                             or not hasattr(sys, 'pypy_translation_info'))
 
         space = cls.space
         cls.w_cpython_behavior = space.wrap(cpython_behavior)
         cls.w_cpython_version = space.wrap(tuple(sys.version_info))
-        cls.w_appdirect = space.wrap(option.runappdirect)
-        cls.w_cpython_apptest = space.wrap(option.runappdirect and not hasattr(sys, 'pypy_translation_info'))
+        cls.w_appdirect = space.wrap(runappdirect)
+        cls.w_cpython_apptest = space.wrap(runappdirect and not hasattr(sys, 'pypy_translation_info'))
 
         def w_unwrap_wrap_unicode(space, w_obj):
             return space.wrap(space.unicode_w(w_obj))

pypy/objspace/std/test/test_proxy_usercreated.py

 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app
 from pypy.objspace.std.transparent import register_proxyable
-from pypy.conftest import option
 
 class W_Wrapped(Wrappable):
     def new(space, w_type):
 
 class AppTestProxyNewtype(AppProxy):
     def setup_class(cls):
-        if option.runappdirect:
+        if py.test.config.option.runappdirect:
             py.test.skip("Impossible to run on appdirect")
         AppProxy.setup_class.im_func(cls)
         cls.w_wrapped = cls.space.wrap(W_Wrapped())

pypy/objspace/test/test_binop_overriding.py

 # test about the binop operation rule, see issue 412
-from pypy.conftest import option
 
 class AppTestBinopCombinations:
 
     return Base, do_test
 """)
         cls.w_helpers = w_helpers
-        cls.w_appdirect = cls.space.wrap(option.runappdirect)
+        import py
+        cls.w_appdirect = cls.space.wrap(py.test.config.option.runappdirect)
 
     def test_overriding_base_binop_explict(self):
         class MulBase(object):

pypy/tool/pypyjit_child.py

-from pypy.conftest import option
 from rpython.rtyper.lltypesystem import lltype
 from rpython.jit.metainterp import warmspot
 from pypy.module.pypyjit.policy import PyPyJitPolicy
 def apply_jit(interp, graph, CPUClass):
     print 'warmspot.jittify_and_run() started...'
     policy = PyPyJitPolicy()
-    option.view = True
+    import pytest
+    py.test.config.option.view = True
     warmspot.jittify_and_run(interp, graph, [], policy=policy,
                              listops=True, CPUClass=CPUClass,
                              backendopt=True, inline=True)