We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 500ad5a commit b11d9c4Copy full SHA for b11d9c4
unittesting/unit.py
@@ -10,6 +10,27 @@
10
11
try:
12
import coverage
13
+
14
+ # ST4 does not ship `_sysconfigdata__darwin_darwin` module, required by
15
+ # coverage 7.x on MacOS, which causes `sysconfig.add_paths()` to fail.
16
+ # On other OSs it returns potentially unwanted paths outside of ST ecosystem.
17
+ # Thus monkey patch it.
18
+ try:
19
+ import coverage.inorout
20
21
+ def __add_third_party_paths(paths):
22
+ """Return $data/Lib/pythonXY as 3rd-party path."""
23
+ libs_path = os.path.join(
24
+ os.path.dirname(sublime.packages_path()),
25
+ "Lib",
26
+ "python{}{}".format(sys.version_info.major, sys.version_info.minor)
27
+ )
28
+ paths.add(libs_path)
29
30
+ coverage.inorout.add_third_party_paths = __add_third_party_paths
31
+ except:
32
+ pass
33
34
except Exception:
35
coverage = False
36
0 commit comments