Skip to content

Commit

Permalink
Merge pull request #28 from rekcurd/fix/unittest-py37-support
Browse files Browse the repository at this point in the history
Thank you @yuki-mt !
Merged
  • Loading branch information
keigohtr authored Jan 22, 2019
2 parents 017ddec + 5ac087c commit 43f9afd
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: python
dist: trusty
dist: xenial
sudo: true
services:
- docker
Expand All @@ -9,6 +9,8 @@ matrix:
env: TOXENV=py36
- python: 3.6
env: TOXENV=coverage,codecov
- python: 3.7
env: TOXENV=py37
install:
- pip install tox
script:
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fluent-logger==0.9.3
python-json-logger==0.1.9
grpcio==1.13.0
grpcio-tools==1.13.0
PyMySQL==0.8.0
SQLAlchemy==1.2.7
PyYAML==3.12
fluent-logger>=0.9.3 # Apache-2.0
python-json-logger>=0.1.9 # BSD
grpcio>=1.13.0 # Apache-2.0
grpcio-tools>=1.13.0 # Apache-2.0
PyMySQL>=0.8.0 # MIT
SQLAlchemy>=1.2.7 # MIT
PyYAML>=3.12 # MIT
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
)
10 changes: 5 additions & 5 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
coverage==4.5.1
nose==1.3.7
coverage>=4.0.3
nose>=1.3.7
pytest
py==1.5.4
codecov==2.0.15
grpcio-testing==1.13.0
py>=1.4.31
codecov>=1.4.0
grpcio-testing>=1.13.0
4 changes: 2 additions & 2 deletions drucker/test/__init__.py → test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import os

from drucker.logger import JsonServiceLogger, JsonSystemLogger
from drucker.test.dummy_app import DummyApp
from test.dummy_app import DummyApp
import drucker.drucker_worker_servicer


os.environ["DRUCKER_TEST_MODE"] = "True"
os.environ["DRUCKER_SETTINGS_YAML"] = "drucker/test/test-settings.yml"
os.environ["DRUCKER_SETTINGS_YAML"] = "test/test-settings.yml"

app = DummyApp()
service_logger = JsonServiceLogger(app.config)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def patch_predictor(input_type, output_type):
def test_method(func):
@wraps(func)
def inner_method(*args, **kwargs):
with patch('drucker.test.dummy_app.DummyApp.get_type_input',
with patch('test.dummy_app.DummyApp.get_type_input',
new=Mock(return_value=input_type)) as _, \
patch('drucker.test.dummy_app.DummyApp.get_type_output',
patch('test.dummy_app.DummyApp.get_type_output',
new=Mock(return_value=output_type)) as _, \
patch('drucker.test.dummy_app.DummyApp.load_model') as _, \
patch('drucker.test.dummy_app.DummyApp.predict',
patch('test.dummy_app.DummyApp.load_model') as _, \
patch('test.dummy_app.DummyApp.predict',
new=Mock(return_value=_prediction_value_map[output_type])) as _:
return func(*args, **kwargs)
return inner_method
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36
envlist = py36, py37

[testenv]
passenv = TOXENV CI TRAVIS TRAVIS_*
Expand Down

0 comments on commit 43f9afd

Please sign in to comment.