This is an automated email from the ASF dual-hosted git repository.

rskraba pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 7e91f9bd76a2c2c078b6ef8e29700acde7c0f923
Author: Kousuke Saruta <[email protected]>
AuthorDate: Fri Aug 18 10:53:30 2023 +0900

    AVRO-3832: [Python] Make Python test work with Docker (#2444)
    
    * AVRO-3832: [Python] Make Python test work with Docker.
    
    * Use contextlib.closing.
---
 build.sh                              | 2 +-
 lang/py/avro/test/gen_interop_data.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/build.sh b/build.sh
index 7dddbbbc9e..ede4926691 100755
--- a/build.sh
+++ b/build.sh
@@ -350,7 +350,7 @@ do
 
     docker-test)
       tar -cf- share/docker/Dockerfile $DOCKER_EXTRA_CONTEXT |
-        docker build -t avro-test -f share/docker/Dockerfile -
+        DOCKER_BUILDKIT=1 docker build -t avro-test -f share/docker/Dockerfile 
-
       docker run --rm -v "${PWD}:/avro${DOCKER_MOUNT_FLAG}" --env 
"JAVA=${JAVA:-8}" avro-test /avro/share/docker/run-tests.sh
       ;;
 
diff --git a/lang/py/avro/test/gen_interop_data.py 
b/lang/py/avro/test/gen_interop_data.py
index 1993b01282..1bde7ff876 100644
--- a/lang/py/avro/test/gen_interop_data.py
+++ b/lang/py/avro/test/gen_interop_data.py
@@ -23,6 +23,7 @@ import base64
 import io
 import json
 import os
+from contextlib import closing
 from pathlib import Path
 from typing import IO, TextIO
 
@@ -93,7 +94,8 @@ def _parse_args() -> argparse.Namespace:
 
 def main() -> int:
     args = _parse_args()
-    generate(args.schema_path, args.output_path)
+    with closing(args.output_path) as op:
+        generate(args.schema_path, op)
     return 0
 
 

Reply via email to