mirror of https://github.com/docker/docker-py.git
Run tests with pytest
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
36424ca001
commit
6e27c2a3d0
4
Makefile
4
Makefile
|
@ -13,10 +13,10 @@ build-py3:
|
|||
test: unit-test integration-test unit-test-py3 integration-test-py3
|
||||
|
||||
unit-test: build
|
||||
docker run docker-py python tests/test.py
|
||||
docker run docker-py py.test tests/test.py
|
||||
|
||||
unit-test-py3: build-py3
|
||||
docker run docker-py3 python tests/test.py
|
||||
docker run docker-py3 py.test tests/test.py
|
||||
|
||||
integration-test: build
|
||||
docker run -e NOT_ON_HOST=true -v `$(HOST_TMPDIR)`:/tmp -v /var/run/docker.sock:/var/run/docker.sock docker-py python tests/integration_test.py
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
mock==1.0.1
|
||||
coverage==3.7.1
|
||||
pytest==2.7.2
|
||||
pytest-cov==2.1.0
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import fake_stat
|
||||
from . import fake_stat
|
||||
|
||||
CURRENT_VERSION = 'v1.19'
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ import tarfile
|
|||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
import random
|
||||
|
||||
|
@ -35,8 +34,8 @@ import docker
|
|||
import requests
|
||||
import six
|
||||
|
||||
import base
|
||||
import fake_api
|
||||
from . import base
|
||||
from . import fake_api
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
|
@ -2331,6 +2330,3 @@ class StreamTest(Cleanup, base.BaseTestCase):
|
|||
|
||||
self.assertEqual(list(stream), [
|
||||
str(i).encode() for i in range(50)])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import os
|
||||
import os.path
|
||||
import unittest
|
||||
import tempfile
|
||||
|
||||
from docker.client import Client
|
||||
|
@ -13,7 +12,7 @@ from docker.utils import (
|
|||
from docker.utils.ports import build_port_bindings, split_port
|
||||
from docker.auth import resolve_repository_name, resolve_authconfig
|
||||
|
||||
import base
|
||||
from . import base
|
||||
|
||||
|
||||
class UtilsTest(base.BaseTestCase):
|
||||
|
@ -474,6 +473,3 @@ class UtilsTest(base.BaseTestCase):
|
|||
["127.0.0.1:1000:1000", "127.0.0.1:2000:2000"])
|
||||
self.assertEqual(port_bindings["1000"], [("127.0.0.1", "1000")])
|
||||
self.assertEqual(port_bindings["2000"], [("127.0.0.1", "2000")])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -5,11 +5,7 @@ skipsdist=True
|
|||
[testenv]
|
||||
usedevelop=True
|
||||
commands =
|
||||
{envbindir}/coverage run -p tests/test.py
|
||||
{envbindir}/coverage run -p tests/utils_test.py
|
||||
{envbindir}/coverage combine
|
||||
{envbindir}/coverage report
|
||||
{envbindir}/coverage html
|
||||
py.test --cov=docker tests/test.py tests/utils_test.py
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
-r{toxinidir}/requirements.txt
|
||||
|
|
Loading…
Reference in New Issue