Skip to content

Commit c59d674

Browse files
committed
Abomination of a test fix
1 parent 7405197 commit c59d674

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/unit/test_arcade.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from copy import copy
33
import logging
44
import arcade
5+
import inspect
56
from arcade import *
67

78

@@ -16,9 +17,13 @@ def test_import():
1617
remaining = arcade_names - common
1718
for name in copy(remaining):
1819
attr = getattr(arcade, name)
19-
if type(attr) is ModuleType:
20+
if type(attr) is ModuleType or not inspect.isroutine(attr):
2021
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.'):
2227
remaining.remove(name)
2328

2429
assert len(remaining) == 0

0 commit comments

Comments
 (0)