diff options
author | 2022-05-22 10:54:16 +0200 | |
---|---|---|
committer | 2022-05-22 10:54:16 +0200 | |
commit | 8d607e82728af8b47ab080d7fb579248d74fdd58 (patch) | |
tree | a7d3bcdf9e116d379a88cdaf2f877ac08438073f /dev-python/betamax/files | |
parent | dev-python/portend: Enable py3.11 (diff) | |
download | gentoo-8d607e82728af8b47ab080d7fb579248d74fdd58.tar.gz gentoo-8d607e82728af8b47ab080d7fb579248d74fdd58.tar.bz2 gentoo-8d607e82728af8b47ab080d7fb579248d74fdd58.zip |
dev-python/betamax: Modernize and fix tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/betamax/files')
-rw-r--r-- | dev-python/betamax/files/betamax-0.8.1-pytest.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/dev-python/betamax/files/betamax-0.8.1-pytest.patch b/dev-python/betamax/files/betamax-0.8.1-pytest.patch new file mode 100644 index 000000000000..e3bfe39c81ca --- /dev/null +++ b/dev-python/betamax/files/betamax-0.8.1-pytest.patch @@ -0,0 +1,38 @@ +From 165cc321f2b9839418269e9493b03eb2e43f7ddf Mon Sep 17 00:00:00 2001 +From: Jiri Kuncar <jiri.kuncar@gmail.com> +Date: Mon, 9 Sep 2019 12:23:18 +0200 +Subject: [PATCH] tests: fix direct calls to PyTest fixtures + +https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly +--- + tests/unit/test_fixtures.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/unit/test_fixtures.py b/tests/unit/test_fixtures.py +index 387d9ce..41f33eb 100644 +--- a/tests/unit/test_fixtures.py ++++ b/tests/unit/test_fixtures.py +@@ -27,9 +27,9 @@ def test_adds_stop_as_a_finalizer(self): + # Mock a pytest request object + request = mock.MagicMock() + request.cls = request.module = None +- request.function.__name__ = 'test' ++ request.node.name = request.function.__name__ = 'test' + +- pytest_fixture.betamax_recorder(request) ++ pytest_fixture._betamax_recorder(request) + assert request.addfinalizer.called is True + request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop) + +@@ -37,9 +37,9 @@ def test_auto_starts_the_recorder(self): + # Mock a pytest request object + request = mock.MagicMock() + request.cls = request.module = None +- request.function.__name__ = 'test' ++ request.node.name = request.function.__name__ = 'test' + +- pytest_fixture.betamax_recorder(request) ++ pytest_fixture._betamax_recorder(request) + self.mocked_betamax.start.assert_called_once_with() + + |