Skip to content

Commit 51f15ee

Browse files
committed
update some tests with new expectations
- conda is not importable in the frontmost python - sys.executable is in $NB_PYTHON_PREFIX (this was true before, but it's value has changed)
1 parent 5f285b7 commit 51f15ee

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

tests/conda/binder-dir/verify

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env python
22
import sys
3+
from subprocess import check_output
34

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

7+
out = check_output(['conda', '--version']).decode('utf8').strip()
8+
assert out == 'conda 4.5.11', out
9+
610
import numpy
7-
import conda
8-
assert conda.__version__ == '4.5.11', conda.__version__

tests/conda/repo-path/verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import sys
33
import os
44

55
# Python should still be in /srv/conda
6-
assert sys.executable == '/srv/conda/bin/python'
6+
assert sys.executable == os.path.join(os.environ['NB_PYTHON_PREFIX'], 'bin', 'python')
77

88
# Repo should be in /srv/repo
99
assert os.path.exists('/srv/repo/verify')

tests/conda/simple-py2/verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ assert sorted(specs) == ['python2', 'python3'], specs.keys()
1313
import json
1414
from subprocess import check_output
1515
envs = json.loads(check_output(['conda', 'env', 'list', '--json']).decode('utf8'))
16-
assert envs == {'envs': ['/srv/conda', '/srv/conda/envs/kernel']}, envs
16+
assert envs == {'envs': ['/srv/conda', '/srv/conda/envs/kernel', '/srv/conda/envs/notebook']}, envs
1717

1818
pkgs = json.loads(check_output(['conda', 'list', '-n', 'kernel', '--json']).decode('utf8'))
1919
pkg_names = [pkg['name'] for pkg in pkgs]

0 commit comments

Comments
 (0)