Skip to content

Commit

Permalink
Merge pull request #508 from sirosen/py311-testing
Browse files Browse the repository at this point in the history
Test on py3.11-dev and drop py35 from testing and classifiers
  • Loading branch information
sirosen authored Feb 5, 2022
2 parents 19cb184 + 7a20829 commit 724d662
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
31 changes: 9 additions & 22 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,21 @@ jobs:
strategy:
fail-fast: false
matrix:
# for the matrix, macos and linux on
# - py2
# - the lowest supported py3
# - the highest supported py3
# for the matrix, linux on all pythons
#
# any additional builds for windows and other python versions are
# any additional builds for windows and macos
# handled via `include` to avoid an over-large test matrix
os: [ubuntu-latest, macos-latest]
python-version: ["2.7", "3.5", "3.10"]
os: [ubuntu-latest]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev", "pypy-2.7", "pypy-3.7"]
include:
- os: ubuntu-latest
python-version: "3.6"
- os: ubuntu-latest
python-version: "3.7"
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "pypy-2.7"
- os: ubuntu-latest
python-version: "pypy-3.7"
# FIXME: windows builds fail and must therefore be included with
# `ignore-failures: true` which we pass for `continue-on-error` below
- os: windows-latest
python-version: "2.7"
- os: windows-latest
python-version: "3.10"
- os: macos-latest
python-version: "2.7"
- os: macos-latest
python-version: "3.10"
name: "python=${{ matrix.python-version }} os=${{ matrix.os }}"
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -72,7 +59,7 @@ jobs:
if: ${{ matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' }}
- name: test
run: python -m tox -e py
# ignore errors in windows builds (for now)
# FIXME: ignore errors in windows builds (for now)
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: ensure docs build
# docs are only ever built on a linux py3 box (readthedocs)
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: check-merge-conflict
- id: trailing-whitespace
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.3.0
rev: 0.10.2
hooks:
- id: check-github-workflows
- repo: https://github.com/python/black
Expand Down
23 changes: 22 additions & 1 deletion nose2/tests/functional/test_prettyassert.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import sys

from nose2.tests._common import FunctionalTestCase

# detect if DEBUG_RANGES are enabled in the interpreter
#
# for now, assume it's on for py3.11+
#
# in 3.11 this is be part of the env var flag loading logic:
# https://github.com/python/cpython/blob/99fcf1505218464c489d419d4500f126b6d6dc28/Python/initconfig.c#L1722-L1725
#
# if anyone runs into failures because they're setting PYTHONNODEBUGRANGES when running
# tests, we may want to look into how to pull this value from `sys` or a similar module
# note that this can be set via env var or a CLI flag
DEBUG_RANGES = sys.version_info >= (3, 11)


class TestPrettyAsserts(FunctionalTestCase):
def assertProcOutputPattern(self, proc, expected, assert_exit_status=1):
Expand Down Expand Up @@ -166,7 +180,14 @@ def test_unittest_assertion(self):
"scenario/pretty_asserts/unittest_assertion", "-v", "--pretty-assert"
)
# look for typical unittest output
expected = "self.assertTrue\\(x\\)\nAssertionError: False is not true"
expect_lines = [
r"self.assertTrue\(x\)",
r"\s+\^+",
"AssertionError: False is not true",
]
if not DEBUG_RANGES:
del expect_lines[1]
expected = "\n".join(expect_lines)
stderr = self.assertProcOutputPattern(proc, expected)
# the assertion line wasn't reprinted by prettyassert
self.assertNotIn(">>> self.assertTrue", stderr)
Expand Down
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
install_requires=[
"six>=1.7",
"coverage>=4.4.1",
# mock on py2, py3.4 and py3.5
# not just py2: py3 versions of mock don't all have the same
# interface and this can cause issues
'mock==2.0.0;python_version<"3.6"',
],
extras_require={
"coverage_plugin": ["coverage>=4.4.1"],
Expand All @@ -55,7 +51,6 @@
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
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=py27,py35,py36,py37,py38,py39,py310,pypy,pypy3,docs,lint
envlist=py{27,36,37,38,39,310,311},pypy,pypy3,docs,lint

[testenv]
extras = dev
Expand Down

0 comments on commit 724d662

Please sign in to comment.