diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 69a6313..be9967c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,18 +18,17 @@ jobs: fail-fast: false matrix: include: - - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} - - {name: Windows, python: '3.9', os: windows-latest, tox: py39} - - {name: Mac, python: '3.9', os: macos-latest, tox: py39} + - {name: Linux, python: '3.10', os: ubuntu-latest, tox: py310} + - {name: Windows, python: '3.10', os: windows-latest, tox: py310} + - {name: Mac, python: '3.10', os: macos-latest, tox: py310} + - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} - - {name: '2.7', python: '2.7', os: ubuntu-latest, tox: py27} - - {name: 'PyPy2', python: 'pypy2', os: ubuntu-latest, tox: pypy} - - {name: 'PyPy3', python: 'pypy3', os: ubuntu-latest, tox: pypy3} + - {name: '2.7', python: '2.7.18', os: ubuntu-latest, tox: py27} + - {name: 'PyPy3', python: 'pypy-3.9', os: ubuntu-latest, tox: pypy3} steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: update pip diff --git a/.gitignore b/.gitignore index 604a8e8..c6c4daf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ docs/_build tmp.py htmlcov/ - +venv/ *.py[cod] # emacs diff --git a/requirements-test.txt b/requirements-test.txt index f030ce8..ae05d73 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==4.5.1 -pytest==3.0.7 -pytest-cov==2.5.1 +coverage==6.5.0 +pytest==7.2.0 +pytest-cov==4.0.0 tox<3.0 diff --git a/tests/test_formatutils.py b/tests/test_formatutils.py index fee81a7..d7bfaa9 100644 --- a/tests/test_formatutils.py +++ b/tests/test_formatutils.py @@ -29,15 +29,8 @@ _TEST_TMPLS = ["example 1: {hello}", "example 2: {hello:*10}", "example 3: {hello:*{width}}", "example 4: {hello!r:{fchar}{width}}, {width}, yes", - "example 5: {0}, {1:d}, {2:f}, {1}"] - -try: - from collections import OrderedDict -except ImportError: - pass # skip the non-2.6 compatible tests on 2.6 -else: - _TEST_TMPLS.append("example 6: {}, {}, {}, {1}") - del OrderedDict + "example 5: {0}, {1:d}, {2:f}, {1}", + "example 6: {}, {}, {}, {1}"] def test_get_fstr_args(): @@ -45,8 +38,7 @@ def test_get_fstr_args(): for t in _TEST_TMPLS: inferred_t = infer_positional_format_args(t) res = get_format_args(inferred_t) - results.append(res) - return results + assert res def test_split_fstr(): @@ -54,7 +46,7 @@ def test_split_fstr(): for t in _TEST_TMPLS: res = split_format_str(t) results.append(res) - return results + assert res def test_tokenize_format_str(): @@ -62,7 +54,7 @@ def test_tokenize_format_str(): for t in _TEST_TMPLS: res = tokenize_format_str(t) results.append(res) - return results + assert res def test_deferredvalue(): diff --git a/tests/test_urlutils.py b/tests/test_urlutils.py index 2351899..d551ae0 100644 --- a/tests/test_urlutils.py +++ b/tests/test_urlutils.py @@ -99,7 +99,7 @@ def test_idna(): def test_query_params(test_url): url_obj = URL(test_url) if not url_obj.query_params or url_obj.fragment: - return True + return qp_text = url_obj.query_params.to_text(full_quote=True) assert test_url.endswith(qp_text) diff --git a/tox.ini b/tox.ini index 1392927..883f7ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,13 @@ [tox] -envlist = py27,py34,py37,py39,pypy +envlist = py27,py37,py39,py310,pypy3 [testenv] changedir = .tox deps = -rrequirements-test.txt commands = py.test --doctest-modules {envsitepackagesdir}/boltons {toxinidir}/tests {posargs} + +[testenv:py27] +deps = + coverage==5.5 + pytest==4.6.11 + pytest-cov==2.12 +