blob: 50622c9267372595344ed020eae8690eb45b8214 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
From 23659e23d12299a564b12e527ab144d425a2d572 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 1 Jul 2021 09:16:20 +0200
Subject: [PATCH 101/N] Add some platform related tests
So we notice when things change/break
---
.github/workflows/smoketests.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/.github/workflows/smoketests.py b/.github/workflows/smoketests.py
index 1761724..d8f76e6 100644
--- a/.github/workflows/smoketests.py
+++ b/.github/workflows/smoketests.py
@@ -123,6 +123,27 @@ class Tests(unittest.TestCase):
from time import mktime, gmtime
mktime(gmtime())
+ def test_platform_things(self):
+ import sys
+ import sysconfig
+ import platform
+ import importlib.machinery
+ self.assertEqual(sys.implementation.name, "cpython")
+ self.assertEqual(sys.platform, "win32")
+ self.assertTrue(sysconfig.get_platform().startswith("mingw"))
+ self.assertTrue(sysconfig.get_config_var('SOABI').startswith("cpython-"))
+ ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
+ self.assertTrue(ext_suffix.endswith(".pyd"))
+ self.assertTrue("mingw" in ext_suffix)
+ self.assertEqual(sysconfig.get_config_var('SHLIB_SUFFIX'), ".pyd")
+ ext_suffixes = importlib.machinery.EXTENSION_SUFFIXES
+ self.assertTrue(ext_suffix in ext_suffixes)
+ self.assertTrue(".pyd" in ext_suffixes)
+ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])))
+ self.assertEqual(platform.python_implementation(), "CPython")
+ self.assertEqual(platform.system(), "Windows")
+ self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0)
+
def test_c_ext_build(self):
import tempfile
import sys
--
2.32.0
|