Skip to content

Commit

Permalink
Fix unittest for python3.
Browse files Browse the repository at this point in the history
Class names are no very different when defined inside a function.
  • Loading branch information
stephan-hof committed Jun 8, 2017
1 parent 39e6d4a commit cb0a645
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Products/PythonScripts/tests/testPythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,12 @@ def testGlobalIsDeclaration(self):

def test__name__(self):
f = self._filePS('class.__name__')
self.assertEqual(f(), ("'script.foo'>", "'string'"))
if six.PY3:
class_name = "'script.class.__name__.<locals>.foo'>"
else:
class_name = "'script.foo'>"

self.assertEqual(f(), (class_name, "'string'"))

def test_filepath(self):
# This test is meant to raise a deprecation warning.
Expand Down

0 comments on commit cb0a645

Please sign in to comment.