File: test_import.py

package info (click to toggle)
trimesh 4.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 33,416 kB
  • sloc: python: 35,596; makefile: 96; javascript: 85; sh: 38
file content (32 lines) | stat: -rw-r--r-- 755 bytes parent folder | download
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
"""
test_import.py
-------------------

Make sure trimesh is importing right.
"""

import unittest


class ImportTests(unittest.TestCase):
    def test_path(self):
        import os

        # make sure trimesh imports without any environment variables
        # this was failing on `PATH` at some point
        keys = list(os.environ.keys())
        path = {k: os.environ.pop(k) for k in keys}

        # this should succeed with nothing in PATH
        import trimesh

        # not sure if this is necessary but put back removed values
        for key, value in path.items():
            os.environ[key] = value

        # do a very basic operation
        assert trimesh.creation.icosphere().is_volume


if __name__ == "__main__":
    unittest.main()