File: test_inspect.py

package info (click to toggle)
monty 2025.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 820 kB
  • sloc: python: 5,261; makefile: 136; sh: 20
file content (29 lines) | stat: -rw-r--r-- 511 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
from __future__ import annotations

from monty.inspect import all_subclasses, caller_name, find_top_pyfile


class LittleCatA:
    pass


class LittleCatB(LittleCatA):
    pass


class LittleCatC:
    pass


class LittleCatD(LittleCatB):
    pass


class TestInspect:
    def test_func(self):
        # Not a real test. Need something better.
        assert find_top_pyfile()
        assert caller_name()

    def test_all_subclasses(self):
        assert all_subclasses(LittleCatA) == [LittleCatB, LittleCatD]