File: check_disable_c_ext_by_config_file.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 (16 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This test is hard to do in pytest!

from pathlib import Path
import ezdxf

p = Path(__file__).with_name("disable.ini")

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

# It is not possible to deactivate the C-extension by a user config file
# loaded after the ezdxf import, because the setup process of ezdxf is already
# finished.
print(f"using C-Extension (should be True): {ezdxf.options.use_c_ext}")
assert ezdxf.options.use_c_ext is True