diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2022-06-06 14:15:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 14:15:05 +0300 |
commit | 3ee595fc0f4ce832f949057a594979fe74d988cc (patch) | |
tree | 0d52cd1c96b1e70c582e982003fb3f4b1c6e73e9 | |
parent | 446e78409d258b17b457a8eecf302c28bc974ff5 (diff) | |
parent | df86fcb4234ea019c790247336cce041aa56350f (diff) | |
download | testtools-3ee595fc0f4ce832f949057a594979fe74d988cc.tar.gz |
Merge branch 'master' into rm-3.5
-rw-r--r-- | .github/workflows/test.yml | 2 | ||||
-rw-r--r-- | testtools/tests/matchers/test_filesystem.py | 2 | ||||
-rw-r--r-- | testtools/tests/samplecases.py | 2 | ||||
-rw-r--r-- | testtools/tests/test_compat.py | 2 | ||||
-rw-r--r-- | testtools/tests/test_testcase.py | 20 | ||||
-rw-r--r-- | testtools/tests/test_testresult.py | 6 | ||||
-rw-r--r-- | testtools/tests/test_testsuite.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
8 files changed, 19 insertions, 19 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a52e0ad..6d96083 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,7 @@ jobs: - name: Tests run: | - python -m testtools.run testtools.tests.test_suite + python -W once -m testtools.run testtools.tests.test_suite - name: Docs run: | diff --git a/testtools/tests/matchers/test_filesystem.py b/testtools/tests/matchers/test_filesystem.py index c4cd297..a156bbb 100644 --- a/testtools/tests/matchers/test_filesystem.py +++ b/testtools/tests/matchers/test_filesystem.py @@ -223,7 +223,7 @@ class TestSamePath(TestCase, PathHelpers): try: os.symlink(source, target) except (AttributeError, NotImplementedError): - self.skip("No symlink support") + self.skipTest("No symlink support") self.assertThat(source, SamePath(target)) self.assertThat(target, SamePath(source)) diff --git a/testtools/tests/samplecases.py b/testtools/tests/samplecases.py index 3575f57..07447cb 100644 --- a/testtools/tests/samplecases.py +++ b/testtools/tests/samplecases.py @@ -96,7 +96,7 @@ def _failure(case): def _skip(case): - case.skip('arbitrary skip message') + case.skipTest('arbitrary skip message') def _expected_failure(case): diff --git a/testtools/tests/test_compat.py b/testtools/tests/test_compat.py index c09a03c..1246ead 100644 --- a/testtools/tests/test_compat.py +++ b/testtools/tests/test_compat.py @@ -39,7 +39,7 @@ class TestUnicodeOutputStream(testtools.TestCase): def setUp(self): super().setUp() if sys.platform == "cli": - self.skip("IronPython shouldn't wrap streams to do encoding") + self.skipTest("IronPython shouldn't wrap streams to do encoding") def test_no_encoding_becomes_ascii(self): """A stream with no encoding attribute gets ascii/replace strings""" diff --git a/testtools/tests/test_testcase.py b/testtools/tests/test_testcase.py index 48f0dda..00cb60d 100644 --- a/testtools/tests/test_testcase.py +++ b/testtools/tests/test_testcase.py @@ -386,24 +386,24 @@ class TestAssertions(TestCase): Raises( MatchesException(self.failureException, f'.*{foo!r}.*'))) - def test_assertRaisesRegexp(self): - # assertRaisesRegexp asserts that function raises particular exception + def test_assertRaisesRegex(self): + # assertRaisesRegex asserts that function raises particular exception # with particular message. self.assertRaisesRegex(RuntimeError, r"M\w*e", self.raiseError, - RuntimeError, "Message") + RuntimeError, "Message") - def test_assertRaisesRegexp_wrong_error_type(self): + def test_assertRaisesRegex_wrong_error_type(self): # If function raises an exception of unexpected type, - # assertRaisesRegexp re-raises it. - self.assertRaises(ValueError, self.assertRaisesRegexp, RuntimeError, + # assertRaisesRegex re-raises it. + self.assertRaises(ValueError, self.assertRaisesRegex, RuntimeError, r"M\w*e", self.raiseError, ValueError, "Message") - def test_assertRaisesRegexp_wrong_message(self): + def test_assertRaisesRegex_wrong_message(self): # If function raises an exception with unexpected message - # assertRaisesRegexp fails. + # assertRaisesRegex fails. self.assertFails( '"Expected" does not match "Observed"', - self.assertRaisesRegexp, RuntimeError, "Expected", + self.assertRaisesRegex, RuntimeError, "Expected", self.raiseError, RuntimeError, "Observed") def assertFails(self, message, function, *args, **kwargs): @@ -1455,7 +1455,7 @@ class TestSkipping(TestCase): def test_skip_causes_skipException(self): self.assertThat( - lambda: self.skip("Skip this test"), + lambda: self.skipTest("Skip this test"), Raises(MatchesException(self.skipException))) def test_can_use_skipTest(self): diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py index 0c07914..72ffb0a 100644 --- a/testtools/tests/test_testresult.py +++ b/testtools/tests/test_testresult.py @@ -1565,7 +1565,7 @@ class TestTextTestResult(TestCase): DocTestMatches("...\nFAILED (failures=1)\n", doctest.ELLIPSIS)) def test_stopTestRun_shows_details(self): - self.skip("Disabled per bug 1188420") + self.skipTest("Disabled per bug 1188420") def run_tests(): self.result.startTestRun() make_erroring_test().run(self.result) @@ -2517,7 +2517,7 @@ class TestNonAsciiResults(TestCase): # the file without closing it which breaks non-refcounted pythons codecs.lookup(encoding) except LookupError: - self.skip("Encoding unsupported by implementation: %r" % encoding) + self.skipTest("Encoding unsupported by implementation: %r" % encoding) f = codecs.open(os.path.join(self.dir, name + ".py"), "w", encoding) try: f.write(contents) @@ -2567,7 +2567,7 @@ class TestNonAsciiResults(TestCase): return u, u except (LookupError, UnicodeError): pass - self.skip("Could not find a sample text for encoding: %r" % encoding) + self.skipTest("Could not find a sample text for encoding: %r" % encoding) def _as_output(self, text): return text diff --git a/testtools/tests/test_testsuite.py b/testtools/tests/test_testsuite.py index 65cb88d..358ac3a 100644 --- a/testtools/tests/test_testsuite.py +++ b/testtools/tests/test_testsuite.py @@ -253,7 +253,7 @@ class TestFixtureSuite(TestCase): def setUp(self): super().setUp() if FunctionFixture is None: - self.skip("Need fixtures") + self.skipTest("Need fixtures") def test_fixture_suite(self): log = [] @@ -10,4 +10,4 @@ deps = extras = test commands = - python -m testtools.run testtools.tests.test_suite + python -W once -m testtools.run testtools.tests.test_suite |