Skip to content

Commit d789b22

Browse files
committed
Repair docs tests
1 parent ba7dbdd commit d789b22

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

build_livedocs.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ def test_{count}_{header}():
108108
import os
109109
import sys
110110
111-
# For nose
112-
import collections
113-
if not hasattr(collections, "Callable"):
114-
collections.Callable = collections.abc.Callable
115-
116111
import nose
117112
from nose.tools import assert_raises
118113
@@ -121,6 +116,11 @@ def test_{count}_{header}():
121116
from maya import standalone
122117
standalone.initialize()
123118
119+
# For nose
120+
if sys.version_info[0] == 3:
121+
import collections
122+
collections.Callable = collections.abc.Callable
123+
124124
from maya import cmds
125125
import cmdx
126126
@@ -133,6 +133,11 @@ def test_{count}_{header}():
133133
])
134134
135135
result = nose.main(argv=argv, exit=False)
136+
137+
if os.name == "nt":
138+
# Graceful exit, only Windows seems to like this consistently
139+
standalone.uninitialize()
140+
136141
os._exit(0 if result.success else 1)
137142
""")
138143
f.write("".join(tests))

run_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import flaky.flaky_nose_plugin as flaky
77

88
# For nose
9-
import collections
10-
if not hasattr(collections, "Callable"):
9+
if sys.version_info[0] == 3:
10+
import collections
1111
collections.Callable = collections.abc.Callable
1212

1313

0 commit comments

Comments
 (0)