File: check_disable_c_ext_by_env_var.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (18 lines) | stat: -rw-r--r-- 523 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This test is hard to do in pytest!

import os

os.environ["EZDXF_DISABLE_C_EXT"] = "1"

import ezdxf
from ezdxf.math import Vec3
from ezdxf.math._vector import Vec3 as PythonVec3

print(f"disable C-Extension (should be True): {ezdxf.options.disable_c_ext}")
assert ezdxf.options.disable_c_ext is True

print(f"using C-Extension (should be False): {ezdxf.options.use_c_ext}")
assert ezdxf.options.use_c_ext is False

print(f"Vec3 is Python implementation (should be True): {Vec3 is PythonVec3}")
assert Vec3 is PythonVec3