Skip to content

Commit

Permalink
Repair docs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Dec 14, 2023
1 parent ba7dbdd commit d789b22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions build_livedocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ def test_{count}_{header}():
import os
import sys
# For nose
import collections
if not hasattr(collections, "Callable"):
collections.Callable = collections.abc.Callable
import nose
from nose.tools import assert_raises
Expand All @@ -121,6 +116,11 @@ def test_{count}_{header}():
from maya import standalone
standalone.initialize()
# For nose
if sys.version_info[0] == 3:
import collections
collections.Callable = collections.abc.Callable
from maya import cmds
import cmdx
Expand All @@ -133,6 +133,11 @@ def test_{count}_{header}():
])
result = nose.main(argv=argv, exit=False)
if os.name == "nt":
# Graceful exit, only Windows seems to like this consistently
standalone.uninitialize()
os._exit(0 if result.success else 1)
""")
f.write("".join(tests))
4 changes: 2 additions & 2 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import flaky.flaky_nose_plugin as flaky

# For nose
import collections
if not hasattr(collections, "Callable"):
if sys.version_info[0] == 3:
import collections
collections.Callable = collections.abc.Callable


Expand Down

0 comments on commit d789b22

Please sign in to comment.