kopia lustrzana https://github.com/jupyterhub/repo2docker
Add integration tests!
We run jupyter-repo2docker and verify that the things we expect to be installed are installed.pull/42/head
rodzic
ad43fa3aab
commit
514ab7d985
|
@ -0,0 +1,32 @@
|
|||
"""
|
||||
Custom test collector for our integration tests.
|
||||
|
||||
Each directory that has a script named 'verify' is considered
|
||||
a test. jupyter-repo2docker is run on that directory,
|
||||
and then ./verify is run inside the built container. It should
|
||||
return a non-zero exit code for the test to be considered a
|
||||
success.
|
||||
"""
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
def pytest_collect_file(parent, path):
|
||||
if path.basename == 'verify':
|
||||
return Repo(path, parent)
|
||||
|
||||
class Repo(pytest.File):
|
||||
def collect(self):
|
||||
yield RepoTest(self.fspath.basename, self, self.fspath)
|
||||
|
||||
|
||||
class RepoTest(pytest.Item):
|
||||
def __init__(self, name, parent, path):
|
||||
super().__init__(name, parent)
|
||||
self.path = path
|
||||
|
||||
def runtest(self):
|
||||
subprocess.check_call([
|
||||
'jupyter-repo2docker',
|
||||
str(self.path.dirname),
|
||||
'./verify'
|
||||
])
|
|
@ -0,0 +1 @@
|
|||
numpy
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
assert sys.version_info[:2] == (3, 5)
|
||||
|
||||
import numpy
|
|
@ -0,0 +1 @@
|
|||
numpy
|
|
@ -0,0 +1 @@
|
|||
python-2.7
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python2
|
||||
import sys
|
||||
|
||||
print(sys.version_info)
|
||||
assert sys.version_info[:2] == (2, 7)
|
||||
|
||||
import numpy
|
Ładowanie…
Reference in New Issue