diff --git a/_pytest/doctest.py b/_pytest/doctest.py index 737ffe011..6753e5040 100644 --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -78,7 +78,7 @@ class DoctestTextfile(DoctestItem, pytest.File): failed, tot = doctest.testfile( str(self.fspath), module_relative=False, optionflags=doctest.ELLIPSIS, - extraglobs=dict(get_fixture=fixture_request.getfuncargvalue), + extraglobs=dict(getfixture=fixture_request.getfuncargvalue), raise_on_error=True, verbose=0) class DoctestModule(DoctestItem, pytest.File): @@ -94,5 +94,5 @@ class DoctestModule(DoctestItem, pytest.File): fixture_request = FixtureRequest(self) failed, tot = doctest.testmod( module, raise_on_error=True, verbose=0, - extraglobs=dict(get_fixture=fixture_request.getfuncargvalue), + extraglobs=dict(getfixture=fixture_request.getfuncargvalue), optionflags=doctest.ELLIPSIS) diff --git a/doc/en/doctest.txt b/doc/en/doctest.txt index c27247ceb..9f8b8a9db 100644 --- a/doc/en/doctest.txt +++ b/doc/en/doctest.txt @@ -51,8 +51,8 @@ then you can just invoke ``py.test`` without command line options:: ========================= 1 passed in 0.02 seconds ========================= -It is possible to use fixtures using the ``get_fixture`` helper:: +It is possible to use fixtures using the ``getfixture`` helper:: # content of example.rst - >>> tmp = get_fixture('tmpdir') + >>> tmp = getfixture('tmpdir') >>> ... diff --git a/doc/ja/doctest.txt b/doc/ja/doctest.txt index a1064a398..00c9001d2 100644 --- a/doc/ja/doctest.txt +++ b/doc/ja/doctest.txt @@ -74,10 +74,10 @@ Python モジュール (通常 python テストモジュールを含む) の doc ========================= 1 passed in 0.02 seconds ========================= .. - It is possible to use fixtures using the ``get_fixture`` helper:: + It is possible to use fixtures using the ``getfixture`` helper:: -それは ``get_fixture`` ヘルパーを使ってフィクスチャを使用することが可能である:: +それは ``getfixture`` ヘルパーを使ってフィクスチャを使用することが可能である:: # content of example.rst - >>> tmp = get_fixture('tmpdir') + >>> tmp = getfixture('tmpdir') >>> ... diff --git a/testing/test_doctest.py b/testing/test_doctest.py index d95bd2fc9..7b22e906c 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -127,7 +127,7 @@ class TestDoctests: def test_txtfile_with_fixtures(self, testdir): p = testdir.maketxtfile(""" - >>> dir = get_fixture('tmpdir') + >>> dir = getfixture('tmpdir') >>> type(dir).__name__ 'LocalPath' """) @@ -137,7 +137,7 @@ class TestDoctests: def test_doctestmodule_with_fixtures(self, testdir): p = testdir.makepyfile(""" ''' - >>> dir = get_fixture('tmpdir') + >>> dir = getfixture('tmpdir') >>> type(dir).__name__ 'LocalPath' '''