Skip to content

Commit 642a0cc

Browse files
authored
small change (#64)
1 parent 63875fa commit 642a0cc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

_unittests/ut_xrun_doc/test_documentation_examples.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ def add_test_methods(cls):
6565
fold = os.path.normpath(os.path.join(this, "..", "..", "_doc", "examples"))
6666
found = os.listdir(fold)
6767
for name in found:
68-
if name.startswith("plot_") and name.endswith(".py"):
69-
short_name = os.path.split(os.path.splitext(name)[0])[-1]
68+
if not name.startswith("plot_") or not name.endswith(".py"):
69+
continue
70+
short_name = os.path.split(os.path.splitext(name)[0])[-1]
7071

71-
def _test_(self, name=name):
72-
res = self.run_test(fold, name, verbose=VERBOSE)
73-
self.assertTrue(res)
72+
def _test_(self, name=name):
73+
res = self.run_test(fold, name, verbose=VERBOSE)
74+
self.assertTrue(res)
7475

75-
setattr(cls, f"test_{short_name}", _test_)
76+
setattr(cls, f"test_{short_name}", _test_)
7677

7778

7879
TestDocumentationExamples.add_test_methods()

0 commit comments

Comments
 (0)