Skip to content

Commit

Permalink
wip/2
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Mar 21, 2024
1 parent 671abaf commit dbb0c98
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions examples/transitions/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,12 @@ def test_python_path(name):
def test_python_zip():
zip_name = pathlib.Path(f"deploy_{sys.platform}_{platform.machine()}.zip")
if zip_name.exists():
# temp_dir = tempfile.mkdtemp("", "Bazel.runfiles_")
# assert temp_dir

result = subprocess.run(
[sys.executable, os.fspath(zip_name.resolve())], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if result.stdout:
print("stdout: ", result.stdout.decode())
open("/tmp/stdout.log", "wt").write(result.stdout.decode())
if result.stderr:
print("stderr: ", result.stderr.decode())
open("/tmp/stderr.log", "wt").write(result.stderr.decode())

# assert result.returncode == 0

# stdout = result.stdout.decode()
# assert "module 'numpy'" in stdout
# assert "/bin/python3" in stdout
result = subprocess.run([sys.executable, os.fspath(zip_name.resolve())], stdout=subprocess.PIPE)
assert result.returncode == 0

stdout = result.stdout.decode()
assert "module 'numpy'" in stdout
assert "/bin/python3" in stdout


if __name__ == "__main__":
Expand Down

0 comments on commit dbb0c98

Please sign in to comment.