mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Remove six imports and test against oldest allows requirement versions
This commit is contained in:
12
.travis.yml
12
.travis.yml
@@ -1,14 +1,18 @@
|
||||
language: python
|
||||
python: '2.7'
|
||||
env:
|
||||
- TOXENV=py26-unittests
|
||||
- TOXENV=py27-unittests
|
||||
- TOXENV=py33-unittests
|
||||
- TOXENV=py34-unittests
|
||||
- TOXENV=py26-integration
|
||||
- TOXENV=py26-min-req
|
||||
- TOXENV=py26-unittests
|
||||
- TOXENV=py27-integration
|
||||
- TOXENV=py27-min-req
|
||||
- TOXENV=py27-unittests
|
||||
- TOXENV=py33-integration
|
||||
- TOXENV=py33-min-req
|
||||
- TOXENV=py33-unittests
|
||||
- TOXENV=py34-integration
|
||||
- TOXENV=py34-min-req
|
||||
- TOXENV=py34-unittests
|
||||
- TOXENV=flake8
|
||||
install:
|
||||
- pip install tox
|
||||
|
||||
@@ -3,8 +3,6 @@ from __future__ import unicode_literals
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import six
|
||||
|
||||
from mkdocs import utils
|
||||
from mkdocs.config import config_options
|
||||
|
||||
@@ -50,7 +48,7 @@ class TypeTest(unittest.TestCase):
|
||||
|
||||
def test_single_type(self):
|
||||
|
||||
option = config_options.Type(six.string_types)
|
||||
option = config_options.Type(utils.string_types)
|
||||
value = option.validate("Testing")
|
||||
self.assertEqual(value, "Testing")
|
||||
|
||||
@@ -67,7 +65,7 @@ class TypeTest(unittest.TestCase):
|
||||
option.validate, {'a': 1})
|
||||
|
||||
def test_length(self):
|
||||
option = config_options.Type(six.string_types, length=7)
|
||||
option = config_options.Type(utils.string_types, length=7)
|
||||
|
||||
value = option.validate("Testing")
|
||||
self.assertEqual(value, "Testing")
|
||||
|
||||
@@ -7,16 +7,15 @@ import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import six
|
||||
|
||||
from mkdocs import config
|
||||
from mkdocs import utils
|
||||
from mkdocs.config import config_options
|
||||
from mkdocs.exceptions import ConfigurationError
|
||||
from mkdocs.tests.base import dedent
|
||||
|
||||
|
||||
def ensure_utf(string):
|
||||
return string.encode('utf-8') if six.PY2 else string
|
||||
return string.encode('utf-8') if not utils.PY3 else string
|
||||
|
||||
|
||||
class ConfigTests(unittest.TestCase):
|
||||
@@ -118,7 +117,7 @@ class ConfigTests(unittest.TestCase):
|
||||
[custom, os.path.join(theme_dir, 'cosmo'), search_asset_dir],
|
||||
)
|
||||
|
||||
for config_contents, result in six.moves.zip(configs, results):
|
||||
for config_contents, result in zip(configs, results):
|
||||
|
||||
c = config.Config(schema=(
|
||||
('theme', config_options.Theme(default='mkdocs')),
|
||||
|
||||
6
requirements/project-min.txt
Normal file
6
requirements/project-min.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
click==4.0
|
||||
Jinja2==2.7.1
|
||||
livereload==2.3.2
|
||||
Markdown==2.5
|
||||
PyYAML==3.10
|
||||
tornado==4.1
|
||||
9
tox.ini
9
tox.ini
@@ -1,15 +1,16 @@
|
||||
[tox]
|
||||
envlist =
|
||||
{py26,py27,py33,py34}-{unittests,integration},
|
||||
{py26,py27,py33,py34}-{unittests,integration,min-req},
|
||||
flake8
|
||||
|
||||
[testenv]
|
||||
passenv = LANG
|
||||
deps=
|
||||
-rrequirements/project.txt
|
||||
-rrequirements/test.txt
|
||||
{py26,py27,py33,py34}-{unittests,integration}: -rrequirements/project.txt
|
||||
{py26,py27,py33,py34}-min-req: -rrequirements/project-min.txt
|
||||
{py26,py27,py33,py34}-{unittests,min-req}: -rrequirements/test.txt
|
||||
commands=
|
||||
{py26,py27,py33,py34}-unittests: {envbindir}/nosetests --with-coverage --cover-package mkdocs mkdocs
|
||||
{py26,py27,py33,py34}-{unittests,min-req}: {envbindir}/nosetests --with-coverage --cover-package mkdocs mkdocs
|
||||
{py26,py27,py33,py34}-integration: {envbindir}/python -m mkdocs.tests.integration --output={envtmpdir}/builds
|
||||
|
||||
[testenv:flake8]
|
||||
|
||||
Reference in New Issue
Block a user