[pypy-commit] pypy cpyext-test-A: Skip test_thread's tests when running tests against CPython.

devin.jeanpierre pypy.commits at gmail.com
Sun May 1 02:24:29 EDT 2016


Author: Devin Jeanpierre <jeanpierreda at gmail.com>
Branch: cpyext-test-A
Changeset: r84079:8ada27896c7b
Date: 2016-04-30 22:58 -0700
http://bitbucket.org/pypy/pypy/changeset/8ada27896c7b/

Log:	Skip test_thread's tests when running tests against CPython.

diff --git a/pypy/module/cpyext/test/test_thread.py b/pypy/module/cpyext/test/test_thread.py
--- a/pypy/module/cpyext/test/test_thread.py
+++ b/pypy/module/cpyext/test/test_thread.py
@@ -1,9 +1,12 @@
-import py
+import sys
+
+import py, pytest
 
 from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
 
 
 class AppTestThread(AppTestCpythonExtensionBase):
+    @pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only test')
     def test_get_thread_ident(self):
         module = self.import_extension('foo', [
             ("get_thread_ident", "METH_NOARGS",
@@ -30,6 +33,7 @@
 
         assert results[0][0] != results[1][0]
 
+    @pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only test')
     def test_acquire_lock(self):
         module = self.import_extension('foo', [
             ("test_acquire_lock", "METH_NOARGS",
@@ -53,13 +57,14 @@
             ])
         module.test_acquire_lock()
 
+    @pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only test')
     def test_release_lock(self):
         module = self.import_extension('foo', [
             ("test_release_lock", "METH_NOARGS",
              """
 #ifndef PyThread_release_lock
 #error "seems we are not accessing PyPy's functions"
-#endif           
+#endif
                  PyThread_type_lock lock = PyThread_allocate_lock();
                  PyThread_acquire_lock(lock, 1);
                  PyThread_release_lock(lock);
@@ -74,6 +79,7 @@
             ])
         module.test_release_lock()
 
+    @pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only test')
     def test_tls(self):
         module = self.import_extension('foo', [
             ("create_key", "METH_NOARGS",


More information about the pypy-commit mailing list