diff options
| author | Éric Araujo <merwok@netwok.org> | 2020-05-07 14:29:20 -0400 |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2020-05-07 14:29:20 -0400 |
| commit | e1be97b3261661af865a0157f755fdc728b9f1f7 (patch) | |
| tree | 6094838c31cf413554a02ea8f56d36c8f6f82f24 | |
| parent | ce6685e1b4a6c240ce9382464b1e0055a33d2b4a (diff) | |
| parent | 1722cbb7bf40ce9d3793faf38f63e9f00d577613 (diff) | |
| download | pyramid-e1be97b3261661af865a0157f755fdc728b9f1f7.tar.gz pyramid-e1be97b3261661af865a0157f755fdc728b9f1f7.tar.bz2 pyramid-e1be97b3261661af865a0157f755fdc728b9f1f7.zip | |
merge master
| -rw-r--r-- | .coveragerc | 1 | ||||
| -rw-r--r-- | .gitattributes | 5 | ||||
| -rw-r--r-- | .github/workflows/ci-tests.yml | 96 | ||||
| -rw-r--r-- | .travis.yml | 43 | ||||
| -rw-r--r-- | HACKING.txt | 69 | ||||
| -rw-r--r-- | README.rst | 4 | ||||
| -rw-r--r-- | appveyor.yml | 23 | ||||
| -rw-r--r-- | docs/typographical-conventions.rst | 9 | ||||
| -rw-r--r-- | setup.cfg | 12 | ||||
| -rw-r--r-- | setup.py | 2 | ||||
| -rw-r--r-- | src/pyramid/config/actions.py | 4 | ||||
| -rw-r--r-- | src/pyramid/config/adapters.py | 2 | ||||
| -rw-r--r-- | src/pyramid/config/routes.py | 2 | ||||
| -rw-r--r-- | src/pyramid/config/views.py | 6 | ||||
| -rw-r--r-- | src/pyramid/csrf.py | 4 | ||||
| -rw-r--r-- | src/pyramid/i18n.py | 2 | ||||
| -rw-r--r-- | src/pyramid/predicates.py | 2 | ||||
| -rw-r--r-- | src/pyramid/renderers.py | 2 | ||||
| -rw-r--r-- | src/pyramid/scripts/proutes.py | 2 | ||||
| -rw-r--r-- | src/pyramid/static.py | 5 | ||||
| -rw-r--r-- | src/pyramid/urldispatch.py | 2 | ||||
| -rw-r--r-- | src/pyramid/viewderivers.py | 6 | ||||
| -rw-r--r-- | tests/test_config/test_views.py | 2 | ||||
| -rw-r--r-- | tests/test_i18n.py | 1 | ||||
| -rw-r--r-- | tests/test_integration.py | 1 | ||||
| -rw-r--r-- | tests/test_path.py | 4 | ||||
| -rw-r--r-- | tests/test_scripts/test_pserve.py | 12 | ||||
| -rw-r--r-- | tests/test_traversal.py | 1 | ||||
| -rw-r--r-- | tests/test_util.py | 5 | ||||
| -rw-r--r-- | tox.ini | 15 |
30 files changed, 191 insertions, 153 deletions
diff --git a/.coveragerc b/.coveragerc index d0a1fd54a..4009892ea 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,6 +6,7 @@ source = [paths] source = src/pyramid + */src/pyramid */site-packages/pyramid [report] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..a446231f1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Set the default behaviour, in case poeple don't have core.autocrlf set +* text=auto + +# Always lf, this file size is checked in a test +tests/fixtures/static/encoded.html text eol=lf diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 000000000..a16421a0b --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,96 @@ +name: Build and test + +on: + # Only on pushes to master or one of the release branches we build on push + push: + branches: + - master + - "[0-9].[0-9]+-branch" + tags: + # Build pull requests + pull_request: + +jobs: + test: + strategy: + matrix: + py: + - "3.5" + - "3.6" + - "3.7" + - "3.8" + - "pypy3" + os: + - "ubuntu-latest" + - "windows-latest" + - "macos-latest" + architecture: + - x64 + - x86 + + include: + # Only run coverage on ubuntu-latest, except on pypy3 + - os: "ubuntu-latest" + pytest-args: "--cov" + - os: "ubuntu-latest" + py: "pypy3" + pytest-args: "" + + exclude: + # Linux and macOS don't have x86 python + - os: "ubuntu-latest" + architecture: x86 + - os: "macos-latest" + architecture: x86 + # PyPy3 on Windows doesn't seem to work + - os: "windows-latest" + py: "pypy3" + + name: "Python: ${{ matrix.py }}-${{ matrix.architecture }} on ${{ matrix.os }}" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.py }} + architecture: ${{ matrix.architecture }} + - run: pip install tox + - name: Running tox + run: tox -e py -- ${{ matrix.pytest-args }} + coverage: + runs-on: ubuntu-latest + name: Validate coverage + steps: + - uses: actions/checkout@v2 + - name: Setup python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + architecture: x64 + - run: pip install tox + - run: tox -e py38-cover,coverage + docs: + runs-on: ubuntu-latest + name: Build the documentation + steps: + - uses: actions/checkout@v2 + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: x64 + - run: pip install tox + - run: tox -e docs + lint: + runs-on: ubuntu-latest + name: Lint the package + steps: + - uses: actions/checkout@v2 + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: x64 + - run: pip install tox + - run: tox -e lint diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c762c085b..000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Wire up travis -language: python -sudo: false - -matrix: - include: - - python: 3.5 - env: TOXENV=py35 - - python: 3.6 - env: TOXENV=py36 - - python: pypy3 - env: TOXENV=pypy3 - - python: 3.6 - env: TOXENV=py36-cover,coverage - - python: 3.6 - env: TOXENV=docs - - python: 3.6 - env: TOXENV=lint - - python: 3.7 - env: TOXENV=py37 - dist: xenial - sudo: true - - python: 3.8 - env: TOXENV=py38 - dist: xenial - sudo: true - -install: - - travis_retry pip install tox - -script: - - travis_retry tox - -cache: - directories: - - $HOME/.cache/pip - -notifications: - email: - - pyramid-checkins@lists.repoze.org - irc: - channels: - - "chat.freenode.net#pyramid" diff --git a/HACKING.txt b/HACKING.txt index 87c96aef1..730d08208 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -8,7 +8,7 @@ Using a Development Checkout ---------------------------- You will have to create a development environment to hack on Pyramid, using a -Pyramid checkout. We use `tox` to run tests, run test coverage, and build +Pyramid checkout. We use `tox` to run tests, run test coverage, and build documentation. tox docs: https://tox.readthedocs.io/en/latest/ @@ -25,6 +25,22 @@ tox on PyPI: https://pypi.org/project/tox/ Alternatively, create a writeable fork on GitHub and clone it. +- Make sure that `tox` is installed, either in your path, or locally. Examples + below assume that `tox` was installed with: + + $ pip3 install --user tox + $ export TOX=$(python3 -c 'import site; print(site.USER_BASE + "/bin")')/tox + + Feel free to use whatever is your favorite method for installation. One + popular method uses `pipx` (https://github.com/pipxproject/pipx). + + Before you file a pull request, we recommend that you run your proposed + change through `tox`. `tox` will fully validate that all tests work, all + supported formats of documentation will build and their doctests pass, and + test coverage is 100%, across all supported versions of Python. `tox` will + only run builds for Python versions that you have installed and made + available to `tox`. Setting up that environment is outside the scope of this + document. Adding Features --------------- @@ -51,58 +67,43 @@ Coding Style - Pyramid uses Black (https://pypi.org/project/black/) and isort (https://pypi.org/project/isort/) for code formatting style. To run formatters: - $ tox -e format + $ $TOX -e format Running Tests ------------- -- The `tox.ini` uses `nose` and `coverage`. As such `tox` may be used +- The `tox.ini` uses `pytest` and `coverage`. As such `tox` may be used to run groups of tests or only a specific version of Python. For example, the - following command will run tests on Python 3.7 only without coverage: + following command will run tests on the same version of Python that `tox` is + installed with: - $ tox -e py37 + $ $TOX -e py - This command will run tests on the latest version of Python 3 with coverage. + To run `tox` for Python 3.8 explicitly, you may use: - $ tox -e py36-cover,coverage + $ $TOX -e py38 -- To run individual tests (i.e., during development), you can use `nosetests` +- To run individual tests (i.e., during development), you can use `pytest` syntax as follows, where `$VENV` is an environment variable set to the path to your virtual environment: # run a single test - $ $VENV/bin/nosetests tests.test_module:ClassName.test_mytestname + $ $TOX -e py -- tests/test_httpexceptions.py::TestHTTPMethodNotAllowed::test_it_with_default_body_tmpl # run all tests in a class - $ $VENV/bin/nosetests tests.test_module:ClassName - - Optionally you can install a nose plugin `nose-selecttests` to run specific - tests. - https://pypi.org/project/nose-selecttests/ - For example, use a regular expression with the `-t` parameter to run tests. - - # run a single test - $ $VENV/bin/nosetests -t test_mytestname - -- The tests can also be run using `pytest`. - https://docs.pytest.org/en/latest/ - This is intended as a convenience for people who prefer `pytest`. Run the - tests like so: - - $ $VENV/bin/pip install pytest - $ $VENV/bin/pytest --strict pyramid/ tests/ + $ $TOX -e py -- tests/test_httpexceptions.py::TestHTTPMethodNotAllowed - To run individual tests (i.e., during development), see "pytest usage - - Specifying tests / selecting tests": +- For more information on how to use pytest, please refer to the pytest + documentation for selecting tests: https://docs.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests Test Coverage ------------- -- The codebase *must* have 100% test statement coverage after each commit. You - can test coverage via `tox -epy3-cover,coverage`. +- The codebase *must* have 100% test statement coverage after each commit. You + can test coverage via `tox -e py38`. Documentation Coverage and Building HTML Documentation @@ -111,11 +112,11 @@ Documentation Coverage and Building HTML Documentation If you fix a bug, and the bug requires an API or behavior modification, all documentation in this package which references that API or behavior must be changed to reflect the bug fix, ideally in the same commit that fixes the bug -or adds the feature. To build and review docs, use the following steps. +or adds the feature. To build and review docs, use the following steps. 1. In the main Pyramid checkout directory, run `tox -e docs`: - $ tox -e docs + $ $TOX -e docs 2. Open the `.tox/docs/html/index.html` file to see the resulting HTML rendering. @@ -125,6 +126,6 @@ Change Log ---------- - Feature additions and bugfixes must be added to the `CHANGES.rst` - file in the prevailing style. Changelog entries should be long and - descriptive, not cryptic. Other developers should be able to know + file in the prevailing style. Changelog entries should be long and + descriptive, not cryptic. Other developers should be able to know what your changelog entry means. diff --git a/README.rst b/README.rst index 41da33fcb..82f171f89 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ Pyramid ======= -.. image:: https://travis-ci.org/Pylons/pyramid.png?branch=master - :target: https://travis-ci.org/Pylons/pyramid +.. image:: https://github.com/Pylons/Pyramid/workflows/Build%20and%20test/badge.svg?branch=master + :target: https://github.com/Pylons/Pyramid/actions?query=workflow%3A%22Build+and+test%22 :alt: master Travis CI Status .. image:: https://readthedocs.org/projects/pyramid/badge/?version=master diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ba07274f8..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -environment: - matrix: - - PYTHON: "C:\\Python35" - TOXENV: "py35" - - PYTHON: "C:\\Python36" - TOXENV: "py36" - - PYTHON: "C:\\Python37" - TOXENV: "py37" - - PYTHON: "C:\\Python38" - TOXENV: "py38" - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -version: '{branch}.{build}' - -install: - - "%PYTHON%\\python.exe -m pip install tox" - -build: off - -test_script: - - "%PYTHON%\\Scripts\\tox.exe" diff --git a/docs/typographical-conventions.rst b/docs/typographical-conventions.rst index 7f052cbc8..9a83a16f1 100644 --- a/docs/typographical-conventions.rst +++ b/docs/typographical-conventions.rst @@ -98,10 +98,11 @@ ini: .. code-block:: ini - [nosetests] - match=^test - where=pyramid - nocapture=1 + [tool:pytest] + python_files = test_*.py + testpaths = + tests + addopts = -W always Interactive Python: @@ -1,10 +1,6 @@ [easy_install] zip_ok = false -[nosetests] -match = ^test -nocapture = 1 - [aliases] dev = develop easy_install pyramid[testing] docs = develop easy_install pyramid[docs] @@ -15,9 +11,17 @@ license_file = LICENSE.txt [check-manifest] ignore = .gitignore + .gitattributes PKG-INFO *.egg-info *.egg-info/* ignore-default-rules = true ignore-bad-ideas = tests/pkgs/localeapp/**/*.mo + tests/pkgs/localeapp/**/*.mo + +[tool:pytest] +python_files = test_*.py +testpaths = + tests +addopts = -W always @@ -51,7 +51,7 @@ docs_extras = [ 'sphinxcontrib-autoprogram', ] -testing_extras = tests_require + ['coverage', 'nose'] +testing_extras = tests_require + ['coverage', 'pytest', 'pytest-cov'] branch_version = ".".join(VERSION.split(".")[:2]) diff --git a/src/pyramid/config/actions.py b/src/pyramid/config/actions.py index 4003a6e3f..b19f35b9b 100644 --- a/src/pyramid/config/actions.py +++ b/src/pyramid/config/actions.py @@ -398,8 +398,8 @@ def resolveConflicts(actions, state=None): # error out if we went backward in order if state.min_order is not None and order < state.min_order: r = [ - 'Actions were added to order={0} after execution had moved ' - 'on to order={1}. Conflicting actions: '.format( + 'Actions were added to order={} after execution had moved ' + 'on to order={}. Conflicting actions: '.format( order, state.min_order ) ] diff --git a/src/pyramid/config/adapters.py b/src/pyramid/config/adapters.py index 6a8a0aa32..5035651cb 100644 --- a/src/pyramid/config/adapters.py +++ b/src/pyramid/config/adapters.py @@ -121,7 +121,7 @@ class AdaptersConfiguratorMixin: # with all args, the eventonly hack would not have been required. # At this point, though, using .subscriptions and manual execution # is not possible without badly breaking backwards compatibility. - if all((predicate(*arg) for predicate in predicates)): + if all(predicate(*arg) for predicate in predicates): return derived_subscriber(*arg) if hasattr(subscriber, '__name__'): diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py index 41c7108df..4896ce0ea 100644 --- a/src/pyramid/config/routes.py +++ b/src/pyramid/config/routes.py @@ -389,7 +389,7 @@ class RoutesConfiguratorMixin: scheme = parsed.scheme else: scheme = request.scheme - kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc) + kw['_app_url'] = '{}://{}'.format(scheme, parsed.netloc) if original_pregenerator: elements, kw = original_pregenerator(request, elements, kw) diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index ebef7840d..170f8a028 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -196,7 +196,7 @@ def predicated_view(view, info): return view(context, request) def checker(context, request): - return all((predicate(context, request) for predicate in preds)) + return all(predicate(context, request) for predicate in preds) predicate_wrapper.__predicated__ = checker predicate_wrapper.__predicates__ = preds @@ -2322,7 +2322,7 @@ class StaticURLInfo: rawspec = None if pkg_name is not None: - pathspec = '{0}:{1}{2}'.format(pkg_name, pkg_subpath, subpath) + pathspec = '{}:{}{}'.format(pkg_name, pkg_subpath, subpath) overrides = registry.queryUtility(IPackageOverrides, name=pkg_name) if overrides is not None: resource_name = posixpath.join(pkg_subpath, subpath) @@ -2330,7 +2330,7 @@ class StaticURLInfo: for source, filtered_path in sources: rawspec = source.get_path(filtered_path) if hasattr(source, 'pkg_name'): - rawspec = '{0}:{1}'.format(source.pkg_name, rawspec) + rawspec = '{}:{}'.format(source.pkg_name, rawspec) break else: diff --git a/src/pyramid/csrf.py b/src/pyramid/csrf.py index 75ad1b734..4c3689714 100644 --- a/src/pyramid/csrf.py +++ b/src/pyramid/csrf.py @@ -335,7 +335,7 @@ def check_csrf_origin( request.registry.settings.get("pyramid.csrf_trusted_origins", []) ) - if request.host_port not in set(["80", "443"]): + if request.host_port not in {"80", "443"}: trusted_origins.append("{0.domain}:{0.host_port}".format(request)) else: trusted_origins.append(request.domain) @@ -360,6 +360,6 @@ def check_csrf_origin( if not any( is_same_domain(originp.netloc, host) for host in trusted_origins ): - return _fail("{0} does not match any trusted origins.".format(origin)) + return _fail("{} does not match any trusted origins.".format(origin)) return True diff --git a/src/pyramid/i18n.py b/src/pyramid/i18n.py index da8068f35..8c7d01d39 100644 --- a/src/pyramid/i18n.py +++ b/src/pyramid/i18n.py @@ -220,7 +220,7 @@ def get_localizer(request): return request.localizer -class Translations(gettext.GNUTranslations, object): +class Translations(gettext.GNUTranslations): """An extended translation catalog class (ripped off from Babel) """ DEFAULT_DOMAIN = 'messages' diff --git a/src/pyramid/predicates.py b/src/pyramid/predicates.py index 0c74ed6d5..576bbbce6 100644 --- a/src/pyramid/predicates.py +++ b/src/pyramid/predicates.py @@ -281,7 +281,7 @@ class EffectivePrincipalsPredicate: if is_nonstr_iter(val): self.val = set(val) else: - self.val = set((val,)) + self.val = {val} def text(self): return 'effective_principals = %s' % sorted(list(self.val)) diff --git a/src/pyramid/renderers.py b/src/pyramid/renderers.py index b17c7d64d..8da6270c3 100644 --- a/src/pyramid/renderers.py +++ b/src/pyramid/renderers.py @@ -387,7 +387,7 @@ class JSONP(JSON): ) ct = 'application/javascript' - body = '/**/{0}({1});'.format(callback, val) + body = '/**/{}({});'.format(callback, val) response = request.response if response.content_type == response.default_content_type: response.content_type = ct diff --git a/src/pyramid/scripts/proutes.py b/src/pyramid/scripts/proutes.py index 75db52182..64cd37727 100644 --- a/src/pyramid/scripts/proutes.py +++ b/src/pyramid/scripts/proutes.py @@ -82,7 +82,7 @@ def _get_request_methods(route_request_methods, view_request_methods): if has_methods and not request_methods: request_methods = '<route mismatch>' elif request_methods: - if excludes and request_methods == set([ANY_KEY]): + if excludes and request_methods == {ANY_KEY}: for exclude in excludes: request_methods.add('!%s' % exclude) diff --git a/src/pyramid/static.py b/src/pyramid/static.py index bf843f385..ccd6404da 100644 --- a/src/pyramid/static.py +++ b/src/pyramid/static.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from functools import lru_cache import json import mimetypes @@ -260,7 +259,7 @@ def _add_vary(response, option): response.vary = vary -_seps = set(['/', os.sep]) +_seps = {'/', os.sep} def _contains_slash(item): @@ -269,7 +268,7 @@ def _contains_slash(item): return True -_has_insecure_pathelement = set(['..', '.', '']).intersection +_has_insecure_pathelement = {'..', '.', ''}.intersection @lru_cache(1000) diff --git a/src/pyramid/urldispatch.py b/src/pyramid/urldispatch.py index 37bc70962..7aea1146b 100644 --- a/src/pyramid/urldispatch.py +++ b/src/pyramid/urldispatch.py @@ -85,7 +85,7 @@ class RoutesMapper: if match is not None: preds = route.predicates info = {'match': match, 'route': route} - if preds and not all((p(info, request) for p in preds)): + if preds and not all(p(info, request) for p in preds): continue return info diff --git a/src/pyramid/viewderivers.py b/src/pyramid/viewderivers.py index 7f15559b1..6461c4829 100644 --- a/src/pyramid/viewderivers.py +++ b/src/pyramid/viewderivers.py @@ -46,10 +46,8 @@ class DefaultViewMapper: def __call__(self, view): if is_unbound_method(view) and self.attr is None: raise ConfigurationError( - ( - 'Unbound method calls are not supported, please set the ' - 'class as your `view` and the method as your `attr`' - ) + 'Unbound method calls are not supported, please set the ' + 'class as your `view` and the method as your `attr`' ) if inspect.isclass(view): diff --git a/tests/test_config/test_views.py b/tests/test_config/test_views.py index 6b34f1bd4..2a55ad45d 100644 --- a/tests/test_config/test_views.py +++ b/tests/test_config/test_views.py @@ -3099,7 +3099,7 @@ class TestMultiView(unittest.TestCase): ) mv.add('view5', 100, accept='text/xml') self.assertEqual(mv.media_views['text/xml'], [(100, 'view5', None)]) - self.assertEqual(set(mv.accepts), set(['text/xml', 'text/html'])) + self.assertEqual(set(mv.accepts), {'text/xml', 'text/html'}) self.assertEqual(mv.views, [(99, 'view2', None), (100, 'view', None)]) def test_add_with_phash(self): diff --git a/tests/test_i18n.py b/tests/test_i18n.py index b5500af37..b8b11830e 100644 --- a/tests/test_i18n.py +++ b/tests/test_i18n.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import os import unittest diff --git a/tests/test_integration.py b/tests/test_integration.py index 9a690a8d3..638ddb2c5 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import datetime import gc import locale diff --git a/tests/test_path.py b/tests/test_path.py index 384460fb1..c9cfde2b6 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -101,10 +101,10 @@ class TestCallerPackage(unittest.TestCase): self.assertEqual(result, tests) def test_it_level_3(self): - import unittest + import _pytest result = self._callFUT(3) - self.assertEqual(result, unittest) + self.assertEqual(result, _pytest) def test_it_package(self): import tests diff --git a/tests/test_scripts/test_pserve.py b/tests/test_scripts/test_pserve.py index 2feecf3e0..5e5c28c7b 100644 --- a/tests/test_scripts/test_pserve.py +++ b/tests/test_scripts/test_pserve.py @@ -89,13 +89,11 @@ class TestPServeCommand(unittest.TestCase): self.assertEqual(loader.calls[0]['defaults'], {'a': '1'}) self.assertEqual( inst.watch_files, - set( - [ - os.path.abspath('/base/foo'), - os.path.abspath('/baz'), - os.path.abspath(os.path.join(here, '*.py')), - ] - ), + { + os.path.abspath('/base/foo'), + os.path.abspath('/baz'), + os.path.abspath(os.path.join(here, '*.py')), + }, ) def test_config_file_finds_open_url(self): diff --git a/tests/test_traversal.py b/tests/test_traversal.py index ec61fa5b8..b99862ba0 100644 --- a/tests/test_traversal.py +++ b/tests/test_traversal.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import unittest from urllib.parse import quote diff --git a/tests/test_util.py b/tests/test_util.py index 93493c683..8ed082ee4 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -472,7 +472,7 @@ class Test_object_description(unittest.TestCase): self.assertEqual(self._callFUT(('a', 'b')), "('a', 'b')") def test_set(self): - self.assertEqual(self._callFUT(set(['a'])), "{'a'}") + self.assertEqual(self._callFUT({'a'}), "{'a'}") def test_list(self): self.assertEqual(self._callFUT(['a']), "['a']") @@ -492,8 +492,7 @@ class Test_object_description(unittest.TestCase): def test_method(self): self.assertEqual( self._callFUT(self.test_method), - 'method test_method of class tests.test_util.' - 'Test_object_description', + 'function tests.test_util.test_method', ) def test_class(self): @@ -2,19 +2,23 @@ envlist = lint, py35,py36,py37,py38,pypy3, - docs,py36-cover,coverage, + py38-cover,coverage, + docs [testenv] commands = - cover: coverage run \ - {envbindir}/nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:} + python --version + pytest {posargs:} extras = testing -deps = - cover: coverage setenv = COVERAGE_FILE=.coverage.{envname} +[testenv:py38-cover] +commands = + python --version + pytest --cov {posargs:} + [testenv:lint] skip_install = true commands = @@ -54,6 +58,7 @@ deps = coverage setenv = COVERAGE_FILE=.coverage +depends = py38-cover [testenv:format] skip_install = true |
