rename `get_fixture` to `getfixture` to better match the current API style
--HG-- branch : doctest-fixtures
This commit is contained in:
parent
da3b42ce46
commit
dfcb0e322c
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
>>> ...
|
||||
|
|
|
@ -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')
|
||||
>>> ...
|
||||
|
|
|
@ -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'
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue