File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2
2
from copy import copy
3
3
import logging
4
4
import arcade
5
+ import inspect
5
6
from arcade import *
6
7
7
8
@@ -16,9 +17,13 @@ def test_import():
16
17
remaining = arcade_names - common
17
18
for name in copy (remaining ):
18
19
attr = getattr (arcade , name )
19
- if type (attr ) is ModuleType :
20
+ if type (attr ) is ModuleType or not inspect . isroutine ( attr ) :
20
21
remaining .remove (name )
21
- elif not attr .__module__ .startswith ('arcade.' ):
22
+ # Extra awful trick because:
23
+ # 1. attempting to get __module__ of bool members raises AttributeError
24
+ # 2. inspect.isbuiltin(bool) does not return True for bool
25
+ # 2. inspect.getmodule(bool) returns the builtins module
26
+ elif not inspect .getmodule (attr ).__name__ .startswith ('arcade.' ):
22
27
remaining .remove (name )
23
28
24
29
assert len (remaining ) == 0
You can’t perform that action at this time.
0 commit comments