summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert JW Regeer <xistence@0x58.com>2020-05-28 16:58:54 -0700
committerGitHub <noreply@github.com>2020-05-28 16:58:54 -0700
commit412fadefabdddda7481fba1bc86958d2f3d10631 (patch)
tree7c0c549662d393d3657679b502f524dacd1cda79
parent683bc742f7b08db563f3385796809c09babf004b (diff)
parentb19492dbbe5cebbabb91f01ae312d951b39ee931 (diff)
downloadpyramid-412fadefabdddda7481fba1bc86958d2f3d10631.tar.gz
pyramid-412fadefabdddda7481fba1bc86958d2f3d10631.tar.bz2
pyramid-412fadefabdddda7481fba1bc86958d2f3d10631.zip
Merge pull request #3588 from Pylons/fix/pytest_runner
Fix: pytest runner
-rw-r--r--setup.py6
-rw-r--r--src/pyramid/config/settings.py2
-rw-r--r--src/pyramid/i18n.py2
-rw-r--r--tests/test_path.py4
-rw-r--r--tests/test_util.py3
5 files changed, 11 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 1a334efe2..0596a0194 100644
--- a/setup.py
+++ b/setup.py
@@ -51,7 +51,11 @@ docs_extras = [
'sphinxcontrib-autoprogram',
]
-testing_extras = tests_require + ['coverage', 'pytest', 'pytest-cov']
+testing_extras = tests_require + [
+ 'coverage',
+ 'pytest>=5.4.2', # unittest.TestCase funkyness, see commit 77c1505ab
+ 'pytest-cov',
+]
branch_version = ".".join(VERSION.split(".")[:2])
diff --git a/src/pyramid/config/settings.py b/src/pyramid/config/settings.py
index d47743ec7..076c455d4 100644
--- a/src/pyramid/config/settings.py
+++ b/src/pyramid/config/settings.py
@@ -78,7 +78,7 @@ def Settings(d=None, _environ_=os.environ, **kw):
value = type_(value)
d.update({k: value for k in keys})
- def O(settings_key, override_key): # noqa: E743
+ def O(settings_key, override_key): # noqa: E743, E741
for key in expand_key(settings_key):
d[key] = d[key] or d[override_key]
diff --git a/src/pyramid/i18n.py b/src/pyramid/i18n.py
index 8c7d01d39..8bf091c58 100644
--- a/src/pyramid/i18n.py
+++ b/src/pyramid/i18n.py
@@ -263,7 +263,7 @@ class Translations(gettext.GNUTranslations):
if locales is not None:
if not isinstance(locales, (list, tuple)):
locales = [locales]
- locales = [str(l) for l in locales]
+ locales = [str(locale) for locale in locales]
if not domain:
domain = cls.DEFAULT_DOMAIN
filename = gettext.find(domain, dirname, locales)
diff --git a/tests/test_path.py b/tests/test_path.py
index c9cfde2b6..384460fb1 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 _pytest
+ import unittest
result = self._callFUT(3)
- self.assertEqual(result, _pytest)
+ self.assertEqual(result, unittest)
def test_it_package(self):
import tests
diff --git a/tests/test_util.py b/tests/test_util.py
index 8ed082ee4..0fb975f66 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -492,7 +492,8 @@ class Test_object_description(unittest.TestCase):
def test_method(self):
self.assertEqual(
self._callFUT(self.test_method),
- 'function tests.test_util.test_method',
+ 'method test_method of class tests.test_util.'
+ 'Test_object_description',
)
def test_class(self):