aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_capi/test_pyatomic.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-31 23:41:18 +0200
committerGitHub <noreply@github.com>2023-08-31 21:41:18 +0000
commit2bd960b57944107fbfbd8ff005b4223e1ea6555f (patch)
tree792ca10d0f2ed817b47df46085079b374bc043d7 /Lib/test/test_capi/test_pyatomic.py
parentc6d56135e151a19c79d002cb1f1dbcd1c766c51d (diff)
downloadcpython-2bd960b57944107fbfbd8ff005b4223e1ea6555f.tar.gz
cpython-2bd960b57944107fbfbd8ff005b4223e1ea6555f.zip
gh-108337: Add pyatomic.h header (#108701)
This adds a new header that provides atomic operations on common data types. The intention is that this will be exposed through Python.h, although that is not the case yet. The only immediate use is in the test file. Co-authored-by: Sam Gross <colesbury@gmail.com>
Diffstat (limited to 'Lib/test/test_capi/test_pyatomic.py')
-rw-r--r--Lib/test/test_capi/test_pyatomic.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_capi/test_pyatomic.py b/Lib/test/test_capi/test_pyatomic.py
new file mode 100644
index 00000000000..846d6d50c25
--- /dev/null
+++ b/Lib/test/test_capi/test_pyatomic.py
@@ -0,0 +1,15 @@
+import unittest
+from test.support import import_helper
+
+# Skip this test if the _testcapi module isn't available.
+_testcapi = import_helper.import_module('_testcapi')
+
+class PyAtomicTests(unittest.TestCase):
+ pass
+
+for name in sorted(dir(_testcapi)):
+ if name.startswith('test_atomic'):
+ setattr(PyAtomicTests, name, getattr(_testcapi, name))
+
+if __name__ == "__main__":
+ unittest.main()