Commits

Samuele Pedroni committed d1972fa

substitute hack with proper module availability check

Comments (0)

Files changed (1)

lib-python/conftest.py

         regr_script = pypydir.join('tool', 'pytest', 
                                    'run-script', 'regrverbose.py')
         
-        pypy_options = []
-        pypy_options.extend(
-            ['--withmod-%s' % mod for mod in regrtest.usemodules])
-        sopt = " ".join(pypy_options) 
         # we use the regrverbose script to run the test, but don't get
         # confused: it still doesn't set verbose to True by default if
         # regrtest.outputpath() is true, because output tests get confused
             if not execpath.check():
                 execpath = py.path.local.sysfind(option.pypy)
             if not execpath:
-                raise LookupError("could not find executable %r" %(option.pypy,))
+                raise LookupError("could not find executable %r" %
+                                  (option.pypy,))
+
+            # check modules
+            info = py.process.cmdexec("%s --info" % execpath)
+            for mod in regrtest.usemodules:
+                if "objspace.usemodules.%s: False" % mod in info:
+                    py.test.skip("%s module not included in %s" % (mod,
+                                                                   execpath))
+                    
             cmd = "%s %s %s %s" %(
                 execpath, 
                 regrrun, regrrun_verbosity, fspath.purebasename)
                 python, watchdog_script, TIMEOUT,
                 cmd)
         else:
+            pypy_options = []
+            pypy_options.extend(
+                ['--withmod-%s' % mod for mod in regrtest.usemodules])
+            sopt = " ".join(pypy_options) 
+
             cmd = "%s %s %d %s %s %s %s %s" %(
                 python, alarm_script, TIMEOUT, 
                 pypy_script, sopt, 
             else:
                 msg = regrtest.skip
             py.test.skip(msg)
-        # XXX evil hack
-        if 'thread' in regrtest.usemodules:
-            py.test.skip("uses thread")
         (skipped, exit_status, test_stdout,
                                test_stderr) = self.getresult(regrtest)
         if skipped:
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 ProjectModifiedEvent.java.
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.