Skip to content

Commit 1b63d1b

Browse files
committed
test: Fix docs test, used wrong namespace (AcademySoftwareFoundation#4090)
We did `import OpenImageIO as oiio` then instead of using `oiio`, we used `OpenImageIO`. This was failing sometimes. Frankly, I'm not sure why it ever worked. Maybe it works on some versions of Python but not others? I dunno. But this fixes it everywhere and is clearly correct. Signed-off-by: Larry Gritz <[email protected]>
1 parent 4cb956b commit 1b63d1b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

testsuite/docs-examples-python/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55
# https://github.com/AcademySoftwareFoundation/OpenImageIO
66

7+
redirect = " >> out.txt 2>&1 "
78

89
# Prep:
910
command += run_app("cmake -E copy " + test_source_dir + "/../common/grid-small.exr grid.exr")
@@ -12,7 +13,7 @@
1213
# Run the examples for each chapter
1314
for chapter in [ "imageioapi", "imageoutput", "imageinput", "writingplugins",
1415
"imagecache", "texturesys", "imagebuf", "imagebufalgo" ] :
15-
command += pythonbin + " src/docs-examples-" + chapter + ".py >> out.txt ;"
16+
command += pythonbin + " src/docs-examples-" + chapter + ".py " + redirect + " ;"
1617

1718
# hashes merely check that the images don't change, but saves us the space
1819
# of checking in a full copy of the image if it's not needed.

testsuite/docs-examples-python/src/docs-examples-imagebufalgo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ def example_make_texture():
263263
config["maketx:filtername"] = "lanczos3"
264264
config["maketx:opaque_detect"] = 1
265265

266-
ok = ImageBufAlgo.make_texture (OpenImageIO.MakeTxTexture,
266+
ok = ImageBufAlgo.make_texture (oiio.MakeTxTexture,
267267
Input, "texture.exr", config)
268268
if not ok :
269-
print("make_texture error:", OpenImageIO.geterror())
269+
print("make_texture error:", oiio.geterror())
270270

271271
# END-imagebufalgo-make-texture
272272

0 commit comments

Comments
 (0)