mirror of
https://github.com/gryf/slack-backup.git
synced 2025-12-17 11:30:25 +01:00
Fix for python2.7 environment
Python envs used till now python3 for testing, now version of python depends on the environment - for py2* python 2.7 will be used, and for py3* appropriate python3 version will be used. Also, added mock module for python2 envs.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock
|
try:
|
||||||
|
from unittest.mock import MagicMock
|
||||||
|
except ImportError:
|
||||||
|
from mock import MagicMock
|
||||||
|
|
||||||
from slack_backup import client
|
from slack_backup import client
|
||||||
from slack_backup import objects as o
|
from slack_backup import objects as o
|
||||||
|
|||||||
8
tox.ini
8
tox.ini
@@ -4,13 +4,19 @@ envlist = py27,py34,{py27,py34}-flake8
|
|||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython = python3.4
|
|
||||||
usedevelop=True
|
usedevelop=True
|
||||||
setenv = COVERAGE_FILE = .coverage
|
setenv = COVERAGE_FILE = .coverage
|
||||||
commands = py.test --cov=slack_backup --cov-report=term-missing
|
commands = py.test --cov=slack_backup --cov-report=term-missing
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
|
[testenv:py27]
|
||||||
|
usedevelop={[testenv]usedevelop}
|
||||||
|
setenv = {[testenv]setenv}
|
||||||
|
commands = {[testenv]commands}
|
||||||
|
deps = {[testenv]deps}
|
||||||
|
mock
|
||||||
|
|
||||||
[testenv:py27-flake8]
|
[testenv:py27-flake8]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
deps = flake8
|
deps = flake8
|
||||||
|
|||||||
Reference in New Issue
Block a user