Skip to content

Commit

Permalink
update test expectations in py35/py36 tests
Browse files Browse the repository at this point in the history
`/usr/bin/env python` is no longer the kernel python
  • Loading branch information
minrk committed Feb 15, 2023
1 parent 0f328e6 commit 5f6d767
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
21 changes: 16 additions & 5 deletions tests/conda/py35-binder-dir/verify
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
#!/usr/bin/env python
import os
import sys
from subprocess import check_output
from subprocess import STDOUT, check_output

assert sys.version_info[:2] == (3, 5), sys.version
assert sys.version_info[:2] == (3, 7), sys.version

out = check_output(["micromamba", "--version"]).decode("utf8").strip()

def sh(cmd, **kwargs):
return check_output(cmd, **kwargs).decode("utf8").strip()


kernel_python = os.path.join(os.environ["KERNEL_PYTHON_PREFIX"], "bin", "python")
out = sh([kernel_python, "--version"], stderr=STDOUT)
v = out.split()[1]
assert v[:3] == "3.5", out

out = sh(["micromamba", "--version"])
assert out == "1.1.0", out

out = check_output(["mamba", "--version"]).decode("utf8").strip()
out = sh(["mamba", "--version"])
assert (
out
== """mamba 1.1.0
conda 4.13.0"""
), out

import numpy
sh([kernel_python, "-c", "import numpy"])
2 changes: 1 addition & 1 deletion tests/external/reproductions.repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Zenodo record of https://github.com/binder-examples/requirements
- name: 10.5281/zenodo.3242074
url: 10.5281/zenodo.3242074
verify: python -c 'import matplotlib'
verify: /srv/conda/envs/kernel/bin/python -c 'import matplotlib'
# Test that files in git-lfs are properly cloned
- name: LFS
url: https://github.com/binderhub-ci-repos/lfs
Expand Down
8 changes: 4 additions & 4 deletions tests/pipfile/py36/verify
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
#!/srv/conda/envs/kernel/bin/python
import sys

import pypi_pkg_test
import there

print(sys.version_info)
assert sys.version_info[:2] == (3, 6)

import pypi_pkg_test # noqa
import there # noqa
2 changes: 1 addition & 1 deletion tests/venv/py35/verify
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/srv/conda/envs/kernel/bin/python
import sys

print(sys.version_info)
Expand Down

0 comments on commit 5f6d767

Please sign in to comment.