nti.testing 4.0.0__tar.gz → 4.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {nti.testing-4.0.0 → nti_testing-4.2.0}/.pylintrc +9 -13
  2. {nti.testing-4.0.0 → nti_testing-4.2.0}/CHANGES.rst +15 -0
  3. {nti.testing-4.0.0 → nti_testing-4.2.0}/PKG-INFO +21 -7
  4. nti_testing-4.2.0/pyproject.toml +5 -0
  5. nti_testing-4.2.0/setup.cfg +4 -0
  6. {nti.testing-4.0.0 → nti_testing-4.2.0}/setup.py +10 -10
  7. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/__init__.py +0 -1
  8. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/base.py +20 -3
  9. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/layers/postgres.py +6 -2
  10. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/layers/zope.py +0 -2
  11. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/matchers.py +3 -1
  12. nti_testing-4.2.0/src/nti/testing/tests/__init__.py +0 -0
  13. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_base.py +28 -0
  14. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_component_cleanup_broken.txt +0 -1
  15. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_layers.py +1 -1
  16. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_matchers.py +1 -1
  17. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_zodb.py +8 -7
  18. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/time.py +1 -1
  19. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/zodb.py +2 -2
  20. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti.testing.egg-info/PKG-INFO +21 -7
  21. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti.testing.egg-info/SOURCES.txt +1 -5
  22. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti.testing.egg-info/requires.txt +2 -3
  23. nti.testing-4.0.0/.github/workflows/tests.yml +0 -47
  24. nti.testing-4.0.0/.gitignore +0 -8
  25. nti.testing-4.0.0/nose2.cfg +0 -21
  26. nti.testing-4.0.0/setup.cfg +0 -11
  27. nti.testing-4.0.0/src/nti/__init__.py +0 -1
  28. nti.testing-4.0.0/src/nti.testing.egg-info/namespace_packages.txt +0 -1
  29. {nti.testing-4.0.0 → nti_testing-4.2.0}/.coveragerc +0 -0
  30. {nti.testing-4.0.0 → nti_testing-4.2.0}/.isort.cfg +0 -0
  31. {nti.testing-4.0.0 → nti_testing-4.2.0}/.nti_cover_package +0 -0
  32. {nti.testing-4.0.0 → nti_testing-4.2.0}/.readthedocs.yml +0 -0
  33. {nti.testing-4.0.0 → nti_testing-4.2.0}/.travis.yml +0 -0
  34. {nti.testing-4.0.0 → nti_testing-4.2.0}/COPYRIGHT.txt +0 -0
  35. {nti.testing-4.0.0 → nti_testing-4.2.0}/INSTALL +0 -0
  36. {nti.testing-4.0.0 → nti_testing-4.2.0}/LICENSE +0 -0
  37. {nti.testing-4.0.0 → nti_testing-4.2.0}/MANIFEST.in +0 -0
  38. {nti.testing-4.0.0 → nti_testing-4.2.0}/README.rst +0 -0
  39. {nti.testing-4.0.0 → nti_testing-4.2.0}/TODO +0 -0
  40. {nti.testing-4.0.0 → nti_testing-4.2.0}/doc-requirements.txt +0 -0
  41. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/_static/custom.css +0 -0
  42. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/api.rst +0 -0
  43. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/base.rst +0 -0
  44. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/changelog.rst +0 -0
  45. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/conf.py +0 -0
  46. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/index.rst +0 -0
  47. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/layers.rst +0 -0
  48. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/matchers.rst +0 -0
  49. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/time.rst +0 -0
  50. {nti.testing-4.0.0 → nti_testing-4.2.0}/docs/zodb.rst +0 -0
  51. {nti.testing-4.0.0/src/nti/testing/layers/tests → nti_testing-4.2.0/src/nti}/__init__.py +0 -0
  52. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/layers/__init__.py +0 -0
  53. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/layers/cleanup.py +0 -0
  54. {nti.testing-4.0.0/src/nti/testing → nti_testing-4.2.0/src/nti/testing/layers}/tests/__init__.py +0 -0
  55. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/layers/tests/test_postgres.py +0 -0
  56. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/mock.py +0 -0
  57. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_main.py +0 -0
  58. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti/testing/tests/test_time.py +0 -0
  59. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti.testing.egg-info/dependency_links.txt +0 -0
  60. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti.testing.egg-info/top_level.txt +0 -0
  61. {nti.testing-4.0.0 → nti_testing-4.2.0}/src/nti.testing.egg-info/zip-safe +0 -0
  62. {nti.testing-4.0.0 → nti_testing-4.2.0}/tox.ini +0 -0
@@ -1,22 +1,20 @@
1
1
  [MASTER]
2
- load-plugins=
3
- pylint.extensions.broad_try_clause,
4
- pylint.extensions.bad_builtin,
2
+ load-plugins=pylint.extensions.bad_builtin,
5
3
  pylint.extensions.check_elif,
6
4
  pylint.extensions.code_style,
7
- pylint.extensions.comparison_placement,
8
- pylint.extensions.confusing_elif,
9
- pylint.extensions.consider_refactoring_into_while_condition,
10
5
  pylint.extensions.dict_init_mutate,
11
- pylint.extensions.docparams,
12
6
  pylint.extensions.docstyle,
13
7
  pylint.extensions.dunder,
14
- pylint.extensions.eq_without_hash,
8
+ pylint.extensions.comparison_placement,
9
+ pylint.extensions.confusing_elif,
15
10
  pylint.extensions.for_any_all,
11
+ pylint.extensions.consider_refactoring_into_while_condition,
16
12
  pylint.extensions.mccabe,
13
+ pylint.extensions.eq_without_hash,
14
+ pylint.extensions.redefined_variable_type,
17
15
  pylint.extensions.overlapping_exceptions,
16
+ pylint.extensions.docparams,
18
17
  pylint.extensions.private_import,
19
- pylint.extensions.redefined_variable_type,
20
18
  pylint.extensions.set_membership,
21
19
  pylint.extensions.typing,
22
20
 
@@ -42,8 +40,8 @@ load-plugins=
42
40
  # This wants you to turn ``x in (1, 2)`` into ``x in {1, 2}``.
43
41
  # They both result in the LOAD_CONST bytecode, one a tuple one a
44
42
  # frozenset. In theory a set lookup using hashing is faster than
45
- # a linear scan of a tuple; but if the tuple is small, it can
46
- # actually be faster to scan the tuple. This one is debatable.
43
+ # a linear scan of a tuple; but if the tuple is small, it can often
44
+ # actually be faster to scan the tuple.
47
45
  # pylint.extensions.set_membership,
48
46
 
49
47
  # Fix zope.cachedescriptors.property.Lazy; the property-classes doesn't seem to
@@ -124,7 +122,6 @@ init-hook =
124
122
  # readable, thing
125
123
  #
126
124
  # docstring-first-line-empty: That's actually our standard, based on Django.
127
- # empty-comment: Two lines above this would trigger that. Yick.
128
125
  # XXX: unclear on the docstring warnings, missing-type-doc, missing-param-doc,
129
126
  # differing-param-doc, differing-type-doc (are the last two replacements for the first two?)
130
127
  #
@@ -153,7 +150,6 @@ disable=wrong-import-position,
153
150
  differing-type-doc,
154
151
  compare-to-zero,
155
152
  docstring-first-line-empty,
156
- too-many-try-statements,
157
153
 
158
154
  enable=consider-using-augmented-assign
159
155
 
@@ -2,6 +2,21 @@
2
2
  Changes
3
3
  =========
4
4
 
5
+ 4.2.0 (2024-11-06)
6
+ ==================
7
+
8
+ - Add support for Python 3.13.
9
+ - Use native namespace packages.
10
+
11
+
12
+ 4.1.0 (2024-04-10)
13
+ ==================
14
+
15
+ - Add support for, and require, testgres 1.10. This is needed because
16
+ they changed the signature for ``get_pg_version``.
17
+ - Drop support for Python 3.8 and 3.9.
18
+
19
+
5
20
  4.0.0 (2023-10-24)
6
21
  ==================
7
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nti.testing
3
- Version: 4.0.0
3
+ Version: 4.2.0
4
4
  Summary: Support for testing code
5
5
  Home-page: https://github.com/OpenNTI/nti.testing
6
6
  Author: Jason Madden
@@ -13,22 +13,21 @@ Classifier: Natural Language :: English
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3 :: Only
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
23
  Classifier: Topic :: Software Development :: Testing
24
24
  Classifier: Framework :: Zope3
25
- Requires-Python: >=3.8
25
+ Requires-Python: >=3.10
26
26
  License-File: LICENSE
27
27
  Requires-Dist: ZODB>=5.6.0
28
28
  Requires-Dist: zope.interface>=5.4.0
29
29
  Requires-Dist: pyhamcrest
30
30
  Requires-Dist: six
31
- Requires-Dist: setuptools
32
31
  Requires-Dist: transaction
33
32
  Requires-Dist: zope.component
34
33
  Requires-Dist: zope.configuration
@@ -40,13 +39,13 @@ Provides-Extra: test
40
39
  Requires-Dist: Acquisition; extra == "test"
41
40
  Requires-Dist: zope.site; extra == "test"
42
41
  Requires-Dist: zope.testrunner; extra == "test"
43
- Requires-Dist: testgres; extra == "test"
42
+ Requires-Dist: testgres>=1.10; extra == "test"
44
43
  Requires-Dist: psycopg2-binary; platform_python_implementation != "PyPy" and extra == "test"
45
44
  Provides-Extra: docs
46
45
  Requires-Dist: Sphinx; extra == "docs"
47
46
  Requires-Dist: furo; extra == "docs"
48
47
  Provides-Extra: testgres
49
- Requires-Dist: testgres; extra == "testgres"
48
+ Requires-Dist: testgres>=1.10; extra == "testgres"
50
49
  Requires-Dist: psycopg2-binary; platform_python_implementation != "PyPy" and extra == "testgres"
51
50
 
52
51
  =============
@@ -303,6 +302,21 @@ ZODB in `nti.testing.zodb`. See the API documentation for details.
303
302
  Changes
304
303
  =========
305
304
 
305
+ 4.2.0 (2024-11-06)
306
+ ==================
307
+
308
+ - Add support for Python 3.13.
309
+ - Use native namespace packages.
310
+
311
+
312
+ 4.1.0 (2024-04-10)
313
+ ==================
314
+
315
+ - Add support for, and require, testgres 1.10. This is needed because
316
+ they changed the signature for ``get_pg_version``.
317
+ - Drop support for Python 3.8 and 3.9.
318
+
319
+
306
320
  4.0.0 (2023-10-24)
307
321
  ==================
308
322
 
@@ -0,0 +1,5 @@
1
+ [build-system]
2
+ requires = [
3
+ "wheel",
4
+ "setuptools",
5
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,10 +1,12 @@
1
1
  # Copyright 2017 NextThought
2
+ # Copyright 2022-2024 Jason Madden
2
3
  # Released under the terms of the LICENSE file.
3
4
  import codecs
4
- from setuptools import setup, find_packages
5
+ from setuptools import setup
6
+ from setuptools import find_namespace_packages
5
7
 
6
8
 
7
- version = '4.0.0'
9
+ version = '4.2.0'
8
10
 
9
11
  entry_points = {
10
12
  }
@@ -13,7 +15,7 @@ TESTS_REQUIRE = [
13
15
  'Acquisition',
14
16
  'zope.site',
15
17
  'zope.testrunner',
16
- 'testgres',
18
+ 'testgres >= 1.10',
17
19
  'psycopg2-binary; python_implementation != "PyPy"',
18
20
  ]
19
21
 
@@ -40,27 +42,25 @@ setup(
40
42
  'Operating System :: OS Independent',
41
43
  'License :: OSI Approved :: Apache Software License',
42
44
  'Programming Language :: Python :: 3',
43
- 'Programming Language :: Python :: 3.8',
44
- 'Programming Language :: Python :: 3.9',
45
+ 'Programming Language :: Python :: 3 :: Only',
45
46
  'Programming Language :: Python :: 3.10',
46
47
  'Programming Language :: Python :: 3.11',
47
48
  'Programming Language :: Python :: 3.12',
49
+ 'Programming Language :: Python :: 3.13',
48
50
  'Programming Language :: Python :: Implementation :: CPython',
49
51
  'Programming Language :: Python :: Implementation :: PyPy',
50
52
  'Topic :: Software Development :: Testing',
51
53
  'Framework :: Zope3',
52
54
  ],
53
55
  zip_safe=True,
54
- packages=find_packages('src'),
56
+ packages=find_namespace_packages(where='src'),
55
57
  package_dir={'': 'src'},
56
- namespace_packages=['nti'],
57
58
  install_requires=[
58
59
  'ZODB >= 5.6.0',
59
60
  # Error messages changed in 5.1, reprs changed <= 5.4
60
61
  'zope.interface >= 5.4.0',
61
62
  'pyhamcrest',
62
63
  'six',
63
- 'setuptools',
64
64
  'transaction',
65
65
  'zope.component',
66
66
  'zope.configuration',
@@ -78,9 +78,9 @@ setup(
78
78
  'furo',
79
79
  ],
80
80
  'testgres': [
81
- 'testgres',
81
+ 'testgres >= 1.10',
82
82
  'psycopg2-binary; python_implementation != "PyPy"',
83
83
  ],
84
84
  },
85
- python_requires=">=3.8",
85
+ python_requires=">=3.10",
86
86
  )
@@ -52,7 +52,6 @@ from .matchers import provides
52
52
  from .matchers import implements
53
53
  from .matchers import verifiably_provides
54
54
  from .matchers import validly_provides
55
- from .matchers import provides
56
55
  from .matchers import validated_by
57
56
  from .matchers import not_validated_by
58
57
  from .matchers import aq_inContextOf
@@ -94,7 +94,7 @@ class AbstractConfiguringObject(object):
94
94
  package=obj.get_configuration_package())
95
95
 
96
96
  @staticmethod
97
- def _do_configure_packages(obj,
97
+ def _do_configure_packages(obj, # pylint:disable=too-many-positional-arguments
98
98
  set_up_packages=(),
99
99
  features=(),
100
100
  context=_marker,
@@ -400,7 +400,8 @@ class ConfiguringTestBase(AbstractConfiguringObject,
400
400
  def _doSetUpSuper(self):
401
401
  super().setUp()
402
402
 
403
- setUp = AbstractConfiguringObject._doSetUp
403
+ def setUp(self):
404
+ AbstractConfiguringObject._doSetUp(self)
404
405
 
405
406
  #: Configure additional packages. This should only be done in the ``setUp`` method
406
407
  #: of a subclass. Note that this is called by ``setUp``.
@@ -419,7 +420,23 @@ class ConfiguringTestBase(AbstractConfiguringObject,
419
420
  def _doTearDownSuper(self):
420
421
  super().tearDown()
421
422
 
422
- tearDown = AbstractConfiguringObject._doTearDown
423
+ def tearDown(self):
424
+ self._doTearDownConfiguration()
425
+
426
+ def _doTearDownConfiguration(self):
427
+ """
428
+ Hook for subclasses to override.
429
+
430
+ This implementation calls :meth:`AbstractConfiguringObject._doTearDown`
431
+ with the default parameters. If you need to call it with a different
432
+ set of parameters, override this method to do so.
433
+
434
+ This method takes no arguments because the arguments passed to
435
+ ``_doTearDown`` are almost always static at the callsite.
436
+ """
437
+ AbstractConfiguringObject._doTearDown(
438
+ self,
439
+ )
423
440
 
424
441
  class SharedConfiguringTestBase(AbstractConfiguringObject,
425
442
  AbstractSharedTestBase):
@@ -78,7 +78,11 @@ if 'NTI_LOAD_DB_FILE' in os.environ:
78
78
  LOAD_DATABASE_ON_SETUP = os.environ['NTI_LOAD_DB_FILE']
79
79
 
80
80
 
81
- def patched_get_pg_version():
81
+ def patched_get_pg_version(*args, **kwargs):
82
+ # We patch this in testgres.node, so its ok to import
83
+ # the original. In version 1.10, they changed the signature
84
+ # of this function, so be sure to accept whatever it does and
85
+ # pass it on.
82
86
  from testgres.utils import get_pg_version
83
87
  from testgres.node import PgVer
84
88
  from packaging.version import InvalidVersion
@@ -90,7 +94,7 @@ def patched_get_pg_version():
90
94
  # "15.3-0+". If it can't be parsed, then return a fake.
91
95
 
92
96
  try:
93
- version = get_pg_version()
97
+ version = get_pg_version(*args, **kwargs)
94
98
  PgVer(version)
95
99
  except InvalidVersion:
96
100
  print('testgres: Got invalid postgres version', version)
@@ -6,8 +6,6 @@ Test layers for working with Zope libraries.
6
6
  """
7
7
 
8
8
  import gc
9
- import sys
10
- import unittest
11
9
  import logging
12
10
 
13
11
 
@@ -352,7 +352,9 @@ BaseDescription.append_description_of = _append_description_of_map
352
352
 
353
353
 
354
354
  class TypeCheckedDict(dict):
355
- "A dictionary that ensures keys and values are of the required type when set"
355
+ """
356
+ A dictionary that ensures keys and values are of the required type when set
357
+ """
356
358
 
357
359
  def __init__(self, key_class=object, val_class=object, notify=None):
358
360
  dict.__init__(self)
File without changes
@@ -79,6 +79,7 @@ class TestBase(unittest.TestCase):
79
79
  raise AssertionError("Not called")
80
80
 
81
81
  MyTest.setUpClass()
82
+ # pylint:disable-next=simplifiable-if-expression
82
83
  assert_that(gc.isenabled(), is_(False if not base._is_pypy else True))
83
84
  MyTest.tearDownClass()
84
85
  assert_that(gc.isenabled(), is_(True))
@@ -130,3 +131,30 @@ class TestBase(unittest.TestCase):
130
131
  base.module_setup()
131
132
  base.module_setup(set_up_packages=('zope.component',))
132
133
  base.module_teardown()
134
+
135
+ def test_calling_super_linting(self):
136
+ # Deriving a class from our bases and calling their setup
137
+ # methods should NOT produce linter warnings.
138
+ # So this section should not have pylint disable commands.
139
+ class X(base.AbstractTestBase):
140
+ def setUp(self):
141
+ super().setUp()
142
+ self.thing = 1
143
+
144
+ def tearDown(self):
145
+ super().tearDown()
146
+ self.thing = 2
147
+
148
+ class Y(base.ConfiguringTestBase):
149
+ def setUp(self):
150
+ super().setUp()
151
+ self.thing = 1
152
+
153
+ def tearDown(self):
154
+ super().tearDown()
155
+ self.thing = 2
156
+
157
+ X().setUp()
158
+ X().tearDown()
159
+ Y().setUp()
160
+ Y().tearDown()
@@ -17,7 +17,6 @@ We can demonstrate this with some code.
17
17
 
18
18
  First we import the basic modules::
19
19
 
20
- >>> import pkg_resources # to make sure namespace imports work
21
20
  >>> from zope.testing import cleanup
22
21
  >>> from zope import interface
23
22
  >>> from zope import component
@@ -28,7 +28,7 @@ class TestLayers(unittest.TestCase):
28
28
 
29
29
  func()
30
30
 
31
- def via_test(test):
31
+ def via_test(test): # pylint:disable=unused-argument
32
32
  func()
33
33
 
34
34
  via_test(self)
@@ -81,7 +81,7 @@ class TestMatchers(unittest.TestCase):
81
81
  thing = interface.Attribute("thing")
82
82
 
83
83
  def method(): # pylint:disable=no-method-argument
84
- "method"
84
+ """Does nothing."""
85
85
 
86
86
  @interface.implementer(IThing)
87
87
  class Thing(object):
@@ -46,7 +46,7 @@ class MockDBTrans(zodb.mock_db_trans):
46
46
  def __init__(self, db=None):
47
47
  if db is None:
48
48
  db = MockDB()
49
- super(MockDBTrans, self).__init__(db)
49
+ super().__init__(db)
50
50
  self.exc_file = NativeStringIO()
51
51
 
52
52
  class TestMockDBTrans(unittest.TestCase):
@@ -85,7 +85,7 @@ class TestMockDBTrans(unittest.TestCase):
85
85
  with self.assertRaises(zodb._TransactionManagerModeChanged) as exc:
86
86
  with MockDBTrans():
87
87
  transaction.manager.explicit = False
88
- raise Exception("BodyError")
88
+ raise Exception("BodyError") # pylint:disable=broad-exception-raised
89
89
  # The backing exception is included
90
90
  self.assertIn('BodyError', str(exc.exception))
91
91
 
@@ -219,7 +219,8 @@ class TestMockDBTrans(unittest.TestCase):
219
219
  pass
220
220
 
221
221
  class MyFalse(object):
222
- __nonzero__ = __bool__ = lambda _self: False
222
+ def __bool__(self):
223
+ return False
223
224
 
224
225
  transaction.manager.explicit = MyFalse()
225
226
  class MyMock(MockDBTrans):
@@ -276,10 +277,10 @@ class TestZODBLayer(unittest.TestCase):
276
277
 
277
278
 
278
279
  class IExtra(interface.Interface): # pylint:disable=inherit-non-class
279
- "An extra interface"
280
+ """An extra interface."""
280
281
 
281
282
  class IExtra2(interface.Interface): # pylint:disable=inherit-non-class
282
- "Another extra interface"
283
+ """Another extra interface."""
283
284
 
284
285
  class Object(object):
285
286
 
@@ -290,12 +291,12 @@ class TestResetDbCaches(unittest.TestCase):
290
291
  layer = zodb.ZODBLayer
291
292
 
292
293
  def setUp(self):
293
- super(TestResetDbCaches, self).setUp()
294
+ super().setUp()
294
295
  gc.disable()
295
296
 
296
297
  def tearDown(self):
297
298
  gc.enable()
298
- super(TestResetDbCaches, self).tearDown()
299
+ super().tearDown()
299
300
 
300
301
  def test_persistent_site_closed(self):
301
302
  from zope.site.site import LocalSiteManager
@@ -56,7 +56,7 @@ class _TimeWrapper(object):
56
56
 
57
57
  __enter__ = install_fakes
58
58
 
59
- def close(self, *args):
59
+ def close(self, *_args):
60
60
  time.time = _real_time
61
61
  time.gmtime = _real_gmtime
62
62
 
@@ -140,7 +140,7 @@ class mock_db_trans(object):
140
140
  catch = Exception if ignore_errors else ()
141
141
  try:
142
142
  conn.close()
143
- except catch:
143
+ except catch: # pylint:disable=broad-exception-caught
144
144
  self._report_exception("Unexpected error closing connection; ignored.", *sys.exc_info())
145
145
 
146
146
  def __exit__(self, t, v, tb):
@@ -154,7 +154,7 @@ class mock_db_trans(object):
154
154
  tx = self.__current_transaction
155
155
  if not txm.explicit:
156
156
  abort_only = True
157
- error_in_body = _TransactionManagerModeChanged(t, v, tb)
157
+ error_in_body:Exception = _TransactionManagerModeChanged(t, v, tb)
158
158
 
159
159
  try:
160
160
  if txm.get() is not tx:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nti.testing
3
- Version: 4.0.0
3
+ Version: 4.2.0
4
4
  Summary: Support for testing code
5
5
  Home-page: https://github.com/OpenNTI/nti.testing
6
6
  Author: Jason Madden
@@ -13,22 +13,21 @@ Classifier: Natural Language :: English
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3 :: Only
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
23
  Classifier: Topic :: Software Development :: Testing
24
24
  Classifier: Framework :: Zope3
25
- Requires-Python: >=3.8
25
+ Requires-Python: >=3.10
26
26
  License-File: LICENSE
27
27
  Requires-Dist: ZODB>=5.6.0
28
28
  Requires-Dist: zope.interface>=5.4.0
29
29
  Requires-Dist: pyhamcrest
30
30
  Requires-Dist: six
31
- Requires-Dist: setuptools
32
31
  Requires-Dist: transaction
33
32
  Requires-Dist: zope.component
34
33
  Requires-Dist: zope.configuration
@@ -40,13 +39,13 @@ Provides-Extra: test
40
39
  Requires-Dist: Acquisition; extra == "test"
41
40
  Requires-Dist: zope.site; extra == "test"
42
41
  Requires-Dist: zope.testrunner; extra == "test"
43
- Requires-Dist: testgres; extra == "test"
42
+ Requires-Dist: testgres>=1.10; extra == "test"
44
43
  Requires-Dist: psycopg2-binary; platform_python_implementation != "PyPy" and extra == "test"
45
44
  Provides-Extra: docs
46
45
  Requires-Dist: Sphinx; extra == "docs"
47
46
  Requires-Dist: furo; extra == "docs"
48
47
  Provides-Extra: testgres
49
- Requires-Dist: testgres; extra == "testgres"
48
+ Requires-Dist: testgres>=1.10; extra == "testgres"
50
49
  Requires-Dist: psycopg2-binary; platform_python_implementation != "PyPy" and extra == "testgres"
51
50
 
52
51
  =============
@@ -303,6 +302,21 @@ ZODB in `nti.testing.zodb`. See the API documentation for details.
303
302
  Changes
304
303
  =========
305
304
 
305
+ 4.2.0 (2024-11-06)
306
+ ==================
307
+
308
+ - Add support for Python 3.13.
309
+ - Use native namespace packages.
310
+
311
+
312
+ 4.1.0 (2024-04-10)
313
+ ==================
314
+
315
+ - Add support for, and require, testgres 1.10. This is needed because
316
+ they changed the signature for ``get_pg_version``.
317
+ - Drop support for Python 3.8 and 3.9.
318
+
319
+
306
320
  4.0.0 (2023-10-24)
307
321
  ==================
308
322
 
@@ -1,5 +1,4 @@
1
1
  .coveragerc
2
- .gitignore
3
2
  .isort.cfg
4
3
  .nti_cover_package
5
4
  .pylintrc
@@ -13,11 +12,9 @@ MANIFEST.in
13
12
  README.rst
14
13
  TODO
15
14
  doc-requirements.txt
16
- nose2.cfg
17
- setup.cfg
15
+ pyproject.toml
18
16
  setup.py
19
17
  tox.ini
20
- .github/workflows/tests.yml
21
18
  docs/api.rst
22
19
  docs/base.rst
23
20
  docs/changelog.rst
@@ -32,7 +29,6 @@ src/nti/__init__.py
32
29
  src/nti.testing.egg-info/PKG-INFO
33
30
  src/nti.testing.egg-info/SOURCES.txt
34
31
  src/nti.testing.egg-info/dependency_links.txt
35
- src/nti.testing.egg-info/namespace_packages.txt
36
32
  src/nti.testing.egg-info/requires.txt
37
33
  src/nti.testing.egg-info/top_level.txt
38
34
  src/nti.testing.egg-info/zip-safe
@@ -2,7 +2,6 @@ ZODB>=5.6.0
2
2
  zope.interface>=5.4.0
3
3
  pyhamcrest
4
4
  six
5
- setuptools
6
5
  transaction
7
6
  zope.component
8
7
  zope.configuration
@@ -19,13 +18,13 @@ furo
19
18
  Acquisition
20
19
  zope.site
21
20
  zope.testrunner
22
- testgres
21
+ testgres>=1.10
23
22
 
24
23
  [test:platform_python_implementation != "PyPy"]
25
24
  psycopg2-binary
26
25
 
27
26
  [testgres]
28
- testgres
27
+ testgres>=1.10
29
28
 
30
29
  [testgres:platform_python_implementation != "PyPy"]
31
30
  psycopg2-binary
@@ -1,47 +0,0 @@
1
- name: tests
2
-
3
- on: [push, pull_request]
4
-
5
- env:
6
- PYTHONHASHSEED: 1042466059
7
- ZOPE_INTERFACE_STRICT_IRO: 1
8
-
9
-
10
- jobs:
11
- test:
12
- strategy:
13
- matrix:
14
- python-version: ["pypy-3.10", "3.8", "3.9", "3.11", "3.12"]
15
-
16
- runs-on: ubuntu-latest
17
- steps:
18
- - uses: actions/checkout@v3
19
- - name: Set up Python
20
- uses: actions/setup-python@v4
21
- with:
22
- python-version: ${{ matrix.python-version }}
23
- cache: 'pip'
24
- cache-dependency-path: 'setup.py'
25
- - name: Install dependencies
26
- run: |
27
- python -m pip install -U pip setuptools wheel
28
- python -m pip install -U coverage
29
- python -m pip install -U -e ".[test,docs]"
30
- - name: Test
31
- run: |
32
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress
33
- coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctests
34
- - name: Submit to Coveralls
35
- # This is a container action, which only runs on Linux.
36
- uses: AndreMiras/coveralls-python-action@develop
37
- with:
38
- parallel: true
39
-
40
- coveralls_finish:
41
- needs: test
42
- runs-on: ubuntu-latest
43
- steps:
44
- - name: Coveralls Finished
45
- uses: AndreMiras/coveralls-python-action@develop
46
- with:
47
- parallel-finished: true
@@ -1,8 +0,0 @@
1
- .installed.cfg
2
-
3
- *.egg-info
4
- *.pyc
5
- .coverage
6
- htmlcov/
7
-
8
- docs/_build/
@@ -1,21 +0,0 @@
1
- [unittest]
2
- plugins = nose2.plugins.layers
3
- nose2.plugins.doctests
4
-
5
- [log-capture]
6
- always-on = true
7
- clear-handlers = true
8
- loglevel = DEBUG
9
-
10
- #[output-buffer]
11
- #always-on = true
12
- #stderr = true
13
-
14
- [doctest]
15
- always-on = true
16
- extensions = .txt
17
- .rst
18
-
19
- [layer-reporter]
20
- always-on = true
21
- colors = true
@@ -1,11 +0,0 @@
1
- [nosetests]
2
- cover-package = nti.testing
3
- match = [Tt]est[s_]
4
-
5
- [bdist_wheel]
6
- universal = 1
7
-
8
- [egg_info]
9
- tag_build =
10
- tag_date = 0
11
-
@@ -1 +0,0 @@
1
- __import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes