Skip to content

Commit f01ca74

Browse files
committed
Add remainder to list of API names for Python >=3.7
1 parent 960d9bf commit f01ca74

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

vpython/test/test_namespace.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import vpython
23

34
API_NAMES = [
@@ -145,6 +146,14 @@ def test_names_in_base_namspace():
145146
current_names = set(name for name in dir(vpython)
146147
if not name.startswith('_'))
147148
api_name_set = set(API_NAMES)
149+
150+
python_version = sys.version_info
151+
152+
# Python 3.7 added remainder to math, so add it to what we
153+
# expect to see.
154+
if python_version.major == 3 and python_version.minor >= 7:
155+
api_name_set.add('remainder')
156+
148157
print(sorted(api_name_set - current_names))
149158

150159
# We may have added new names, so start with this weaker test

0 commit comments

Comments
 (0)