Skip to content

Commit

Permalink
Configuring for pure-python
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Oct 11, 2024
1 parent 02cebb3 commit 93662a1
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 44 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@ jobs:
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.13", "py313"]
- ["3.14", "py314"]
- ["pypy-3.10", "pypy3"]
- ["3.11", "docs"]
- ["3.11", "coverage"]
- ["3.7", "py37-subunit"]
- ["3.8", "py38-subunit"]
- ["3.9", "py39-subunit"]
- ["3.10", "py310-subunit"]
- ["3.11", "py311-subunit"]
- ["3.12", "py312-subunit"]
- ["3.13.0-alpha - 3.13.0", "py313-subunit"]
- ["3.13", "py313-subunit"]
- ["pypy-3.9", "pypy3-subunit"]
exclude:
- { os: ["windows", "windows-latest"], config: ["3.11", "release-check"] }
Expand Down
12 changes: 7 additions & 5 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "d3455844"
commit-id = "210c1a0c"

[python]
with-pypy = true
with-docs = true
with-sphinx-doctests = false
with-windows = true
with-future-python = true
with-future-python = false
with-macos = false

[coverage]
Expand Down Expand Up @@ -42,7 +42,7 @@ additional-config = [

[tox]
additional-envlist = [
"py{37,38,39,310,311,312,313,py3}-subunit",
"py{38,39,310,311,312,313,py3}-subunit",
]
testenv-deps = [
]
Expand All @@ -54,12 +54,14 @@ use-flake8 = true

[github-actions]
additional-config = [
"- [\"3.7\", \"py37-subunit\"]",
"- [\"3.8\", \"py38-subunit\"]",
"- [\"3.9\", \"py39-subunit\"]",
"- [\"3.10\", \"py310-subunit\"]",
"- [\"3.11\", \"py311-subunit\"]",
"- [\"3.12\", \"py312-subunit\"]",
"- [\"3.13.0-alpha - 3.13.0\", \"py313-subunit\"]",
"- [\"3.13\", \"py313-subunit\"]",
"- [\"pypy-3.9\", \"pypy3-subunit\"]",
]

[pre-commit]
teyit-exclude = "tests/testrunner-ex/sample2/badsyntax\\.py"
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ repos:
rev: 0.4.3
hooks:
- id: teyit
exclude: tests/testrunner-ex/sample2/badsyntax\.py
- repo: https://github.com/PyCQA/flake8
rev: "7.1.1"
hooks:
Expand Down
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
6.6 (unreleased)
================

- Make tests compatible with Python 3.13.0rc3+.
- Make tests compatible with Python 3.13 + add support for that version.
(`#181 <https://github.com/zopefoundation/zope.testrunner/pull/181>`_)

- Drop support for Python 3.7.


6.5 (2024-08-06)
================
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def read(*names):
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -95,7 +94,7 @@ def read(*names):
"Topic :: Software Development :: Testing",
],
namespace_packages=['zope'],
python_requires='>=3.7',
python_requires='>=3.8',
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
entry_points={
Expand Down
4 changes: 2 additions & 2 deletions src/zope/testrunner/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

import doctest
import io
import pdb
import pdb # noqa: T100 import for pdb found
import sys
import threading
import traceback


try:
import ipdb
import ipdb # noqa: T100 import for ipdb found
_ipdb_state = threading.local()
except ImportError:
ipdb = None
Expand Down
2 changes: 1 addition & 1 deletion src/zope/testrunner/selftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Provides setup routines that enable the test runner to test itself.
"""

import pdb
import pdb # noqa: T100 import for pdb found

import zope.testrunner.feature

Expand Down
2 changes: 2 additions & 0 deletions src/zope/testrunner/tests/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
r'(/__init__)?.py{\w+}", [^\n]+\n[^\n]+\n',
re.MULTILINE),
r''),
# Python 3.13+ no longer prints this `--Return--` line in pdb tests.
(re.compile(r'--Return--'), ''),

# disregard trailing whitespace
(re.compile(r'\s+$', re.MULTILINE), ''),
Expand Down
20 changes: 10 additions & 10 deletions src/zope/testrunner/tests/testrunner-ex/sample2/sampletests_ntds.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ class TestSomething(unittest.TestCase):
layer = Layer

def test_something(self):
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found

def test_something2(self):
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found

def test_something3(self):
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found

def test_something4(self):
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found

def test_something5(self):
f()


def f():
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found


def test_set_trace():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class TestSomething(unittest.TestCase):

def test_set_trace1(self):
x = 1
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found
y = x # noqa: F841

def test_set_trace2(self):
Expand All @@ -45,8 +45,8 @@ def test_skipped(self):

def f():
x = 1
import pdb
pdb.set_trace()
import pdb # noqa: T100 import for pdb found
pdb.set_trace() # noqa: T100 pdb.set_trace found
y = x # noqa: F841


Expand Down
19 changes: 6 additions & 13 deletions src/zope/testrunner/tests/testrunner-layers-ntd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,51 +167,44 @@ that is run as a subprocess:
Tear down sample1.sampletests_ntds.Layer ... not supported
Running in a subprocess.
Set up sample2.sampletests_ntds.Layer in 0.000 seconds.
--Return--
> testrunner-ex/sample2/sampletests_ntds.py(37)test_something()->None
-> pdb.set_trace()
-> pdb.set_trace() # noqa: T100 pdb.set_trace found
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
**********************************************************************
--Return--
> testrunner-ex/sample2/sampletests_ntds.py(40)test_something2()->None
-> pdb.set_trace()
-> pdb.set_trace() # noqa: T100 pdb.set_trace found
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
**********************************************************************
--Return--
> testrunner-ex/sample2/sampletests_ntds.py(43)test_something3()->None
-> pdb.set_trace()
-> pdb.set_trace() # noqa: T100 pdb.set_trace found
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
**********************************************************************
--Return--
> testrunner-ex/sample2/sampletests_ntds.py(46)test_something4()->None
-> pdb.set_trace()
-> pdb.set_trace() # noqa: T100 pdb.set_trace found
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
**********************************************************************
--Return--
> testrunner-ex/sample2/sampletests_ntds.py(52)f()->None
-> pdb.set_trace()
-> pdb.set_trace() # noqa: T100 pdb.set_trace found
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
**********************************************************************
--Return--
> <doctest sample2.sampletests_ntds.test_set_trace[0]>(3)?()
-> import pdb; pdb.set_trace()
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
**********************************************************************
--Return--
> testrunner-ex/sample2/sampletests_ntds.py(NNN)f()
-> pdb.set_trace()
-> pdb.set_trace() # noqa: T100 pdb.set_trace found
(Pdb) c
**********************************************************************
Can't use pdb.set_trace when running a layer as a subprocess!
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ envlist =
py311
py312
py313
py314
pypy3
docs
coverage
py{37,38,39,310,311,312,313,py3}-subunit
py{38,39,310,311,312,313,py3}-subunit

[testenv]
usedevelop = true
package = wheel
wheel_build_env = .pkg
pip_pre = py314: true
deps =
setuptools <74
commands =
Expand Down

0 comments on commit 93662a1

Please sign in to comment.