A rewrite of Python's builtin doctest module (with pytest plugin integration) but without all the weirdness

Overview

CircleCI Travis Appveyor Codecov Pypi Downloads ReadTheDocs

https://i.imgur.com/u0tYYxM.png

The xdoctest package is a re-write of Python's builtin doctest module. It replaces the old regex-based parser with a new abstract-syntax-tree based parser (using Python's ast module). The goal is to make doctests easier to write, simpler to configure, and encourage the pattern of test driven development.

Read the docs https://xdoctest.readthedocs.io
Github https://github.com/Erotemic/xdoctest
Pypi https://pypi.org/project/xdoctest
PyCon 2020 Youtube Video and Google Slides

Quick Start

Installation: from pypi

Xdoctest is distributed on pypi as a universal wheel and can be pip installed on Python 2.7, Python 3.4+. Installations are tested on CPython and PyPy implementations.

pip install xdoctest

Distributions on pypi are signed with a GPG public key: D297D757. If you care enough to check the gpg signature (hopefully pip will just do this in the future), you should also verify this agrees with the contents of dev/public_gpg_key.

Usage: Run your Doctests

After installing, the fastest way to run all doctests in your project is:

python -m xdoctest /path/to/your/pkg-or-module.py

or if your module has been pip-installed / is in the PYTHONPATH run

python -m xdoctest yourmodname

Getting Started

There are two ways to use xdoctest: via pytest or via the native interface. The native interface is less opaque and implicit, but its purpose is to run doctests. The other option is to use the widely used pytest package. This allows you to run both unit tests and doctests with the same command and has many other advantages.

It is recommended to use pytest for automatic testing (e.g. in your CI scripts), but for debugging it may be easier to use the native interface.

Check if xdoctest will work on your package

You can quickly check if xdoctest will work on your package out-of-the box by installing it via pip and running python -m xdoctest <pkg> all, where <pkg> is the path to your python package / module (or its name if it is installed in your PYTHONPATH).

For example with you might test if xdoctest works on networkx or sklearn as such: python -m xdoctest networkx all / python -m xdoctest sklearn all.

Using the pytest interface

When pytest is run, xdoctest is automatically discovered, but is disabled by default. This is because xdoctest needs to replace the builtin doctest plugin.

To enable this plugin, run pytest with --xdoctest or --xdoc. This can either be specified on the command line or added to your addopts options in the [pytest] section of your pytest.ini or tox.ini.

To run a specific doctest, xdoctest sets up pytest node names for these doctests using the following pattern: <path/to/file.py>::<callname>:<num>. For example a doctest for a function might look like this mymod.py::funcname:0, and a class method might look like this: mymod.py::ClassName::method:0

Using the native interface.

The xdoctest module contains a pytest plugin, but also contains a native interface. This interface is run programmatically using xdoctest.doctest_module(path), which can be placed in the __main__ section of any module as such:

if __name__ == '__main__':
    import xdoctest as xdoc
    xdoc.doctest_module(__file__)

This sets up the ability to invoke the xdoctest command line interface. python -m <modname> <command>

  • If <command> is all, then each enabled doctest in the module is executed: python -m <modname> all
  • If <command> is list, then the names of each enabled doctest is listed.
  • If <command> is dump, then all doctests are converted into a format suitable for unit testing, and dumped to stdout (new in 0.4.0).
  • If <command> is a callname (name of a function or a class and method), then that specific doctest is executed: python -m <modname> <callname>. Note: you can execute disabled doctests or functions without any arguments (zero-args) this way.

For example if you created a module mymod.py with the following code:

def func1():
    """
    Example:
        >>> assert func1() == 1
    """
    return 1

def func2(a):
    """
    Example:
        >>> assert func2(1) == 2
        >>> assert func2(2) == 3
    """
    return a + 1

if __name__ == '__main__':
    import xdoctest as xdoc
    xdoc.doctest_module(__file__)

You could

  • Use the command python -m mymod list to list the names of all functions with doctests
  • Use the command python -m mymod all to run all functions with doctests
  • Use the command python -m mymod func1 to run only func1's doctest
  • Use the command python -m mymod func2 to run only func2's doctest

Lastly, by running the command xdoc.doctest_module(<pkgname>), xdoctest will recursively find and execute all doctests within the modules belonging to the package.

Zero-args runner

A benefit of using the native interface is the "zero-args" mode in the xdoctest runner. This allows you to run functions in your modules via the command line as long as they take no arguments. The purpose is to create a quick entry point to functions in your code (because xdoctest is taking the space in the __main__ block).

For example, you might create a module mymod.py with the following code:

def myfunc():
    print('hello world')

if __name__ == '__main__':
    import xdoctest as xdoc
    xdoc.doctest_module(__file__)

Even though myfunc has no doctest it can still be run using the command python -m mymod myfunc.

Note, even though "zero-arg" functions can be run via this interface they are not run by python -m mymod all, nor are they listed by python -m mymod list.

Enhancements

The main enhancements xdoctest offers over doctest are:

  1. All lines in the doctest can now be prefixed with >>>. There is no need for the developer to differentiate between PS1 and PS2 lines. However, old-style doctests where PS2 lines are prefixed with ... are still valid.
  2. Additionally, the multi-line strings don't require any prefix (but its ok if they do have either prefix).
  3. Tests are executed in blocks, rather than line-by-line, thus comment-based directives (e.g. # doctest: +SKIP) are now applied to an entire block, rather than just a single line.
  4. Tests without a "want" statement will ignore any stdout / final evaluated value. This makes it easy to use simple assert statements to perform checks in code that might write to stdout.
  5. If your test has a "want" statement and ends with both a value and stdout, both are checked, and the test will pass if either matches.
  6. Ouptut from multiple sequential print statements can now be checked by a single "got" statement. (new in 0.4.0).

See code in _compare/compare.py and _compare/base_diff.py for a demo that illustrates several of these enhancements. This demo mostly shows cases where xdoctest works but doctest fails, but it does show the only corner case I can find where doctest works but xdoctest does not. Feel free to submit more in an issue if you can find any other backwards incompatible cases.

Examples

Here is an example demonstrating the new relaxed (and backwards-compatible) syntax:

def func():
    """
    # Old way
    >>> def func():
    ...     print('The old regex-based parser required specific formatting')
    >>> func()
    The old regex-based parser required specific formatting

    # New way
    >>> def func():
    >>>     print('The new ast-based parser lets you prefix all lines with >>>')
    >>> func()
    The new ast-based parser lets you prefix all lines with >>>
    """
def func():
    """
    # Old way
    >>> print('''
    ... It would be nice if we didnt have to deal with prefixes
    ... in multiline strings.
    ... '''.strip())
    It would be nice if we didnt have to deal with prefixes
    in multiline strings.

    # New way
    >>> print('''
        Multiline can now be written without prefixes.
        Editing them is much more natural.
        '''.strip())
    Multiline can now be written without prefixes.
    Editing them is much more natural.

    # This is ok too
    >>> print('''
    >>> Just prefix everything with >>> and the doctest should work
    >>> '''.strip())
    Just prefix everything with >>> and the doctest should work

    """

Google style doctest support

Additionally, this module is written using Google-style docstrings, and as such, the module was originally written to directly utilize them. However, for backwards compatibility and ease of integration into existing software, the pytest plugin defaults to using the more normal "freestyle" doctests that can be found anywhere in the code.

To make use of Google-style docstrings, pytest can be run with the option --xdoctest-style=google, which causes xdoctest to only look for doctests in Google "docblocks" with an Example: or Doctest: tag.

Notes on Got/Want tests

The new got/want tester is very permissive by default; it ignores differences in whitespace, tries to normalize for python 2/3 Unicode/bytes differences, ANSI formatting, and it uses the old doctest ELLIPSIS fuzzy matcher by default. If the "got" text matches the "want" text at any point, the test passes.

Currently, this permissiveness is not highly configurable as it was in the original doctest module. It is an open question as to whether or not this module should support that level of configuration. If the test requires a high degree of specificity in the got/want checker, it may just be better to use an assert statement.

Backwards Compatibility

We (I) have removed all known backwards syntax incompatibilities. This is based on running doctests on real life examples: boltons, ubelt, networkx, pytorch (pending their acceptance of a pull-request), and on a set of extensive self-testing. Please raise an issue or submit a merge/pull request.

Despite full syntax backwards compatibility, there are directive incompatibilities by design. The directives we expose are more consise and expressive. Our "got"/"want" checker is also much more permissive. We recommend that you rely on coded assert-statements for system-critical code. This also makes it much easier to transform your xdoctest into a unittest when you realize your doctests start getting too long.

Comments
  • Does xdoctest work inside a notebook?

    Does xdoctest work inside a notebook?

    Is there a straight-forward way to run xdoctest inside of a notebook?

    I am testing with Google Colaboratory. I tried a few different way of invoking xdoctest.doctest_module() but they all threw errors.

    The behavior I was expecting would be similar to the built-in doctest (first code block in the example.)

    https://colab.research.google.com/drive/1oOQWUDdFxHKWNiUUjMrJXwPcMaumLy0O?usp=sharing

    bug 
    opened by Sitwon 13
  • Unable to run tests with +REQUIRES(--flag) using pytest

    Unable to run tests with +REQUIRES(--flag) using pytest

    When using pytest to run doctests, I can't figure out a way to run the tests that are marked +REQUIRES(--flag). For example, I was trying to run the tests with +REQUIRES(--web):

    (env3) root@5af053f4ef0e:/wbia/wildbook-ia# pytest --web                 
    ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]         
    pytest: error: unrecognized arguments: --web 
      inifile: /wbia/wildbook-ia/setup.cfg 
      rootdir: /wbia/wildbook-ia
    
    I looked into the xdoctest code and came up with something a bit different: (Edit: This isn't the right thing to do)
    (env3) root@5af053f4ef0e:/wbia/wildbook-ia# pytest --xdoctest-options='+REQUIRES(--web)' wbia/web/apis.py
    ...
                elif action == 'assign':                                     
                    state[key] = value
                elif action == 'set.add':                                    
    >               state[key].add(value)                                    
    E               AttributeError: 'bool' object has no attribute 'add'     
    
    /virtualenv/env3/lib/python3.6/site-packages/xdoctest/directive.py:267: AttributeError
    

    but at least that appears to run the right number of tests, it's just that the tests aren't actually run because of the attribute error in xdoctest.

    This is our pytest config in setup.cfg:

    [tool:pytest]
    minversion = 5.4
    addopts = -p no:doctest --xdoctest --xdoctest-style=google
    testpaths =
        wbia
    filterwarnings =
        default
        ignore:.*No cfgstr given in Cacher constructor or call.*:Warning
        ignore:.*Define the __nice__ method for.*:Warning
    
    opened by karenc 9
  • Catch logger output

    Catch logger output

    Whenever I want to catch and check the logger output in my doctests, I use the following approach (not sure if there is a better way, though):

    import logging
    
    _log = logging.getLogger(__name__)
    debug, info, warn, error = _log.debug, _log.info, _log.warning, _log.error
    
    def funcUnderTest():
      '''
      >>> _log.addHandler(logging.StreamHandler(sys.stdout))
      >>> funcUnderTest()
      Logger output
      '''
      info("Logger output")
    

    Using xdoctest the logger is not caught. Is there a workaround?

    opened by ArneBachmannDLR 8
  • Does not find examples when @property also has a @....setter defined

    Does not find examples when @property also has a @....setter defined

    Running Python 3.8.3 (set up with pyenv), xdoctest 0.12.0 (installed via pip install xdoctest[all]). In a class, when I have an @property defined, with a nice docstring, and then also define a setter, xdoctest does not see the example. Here's a minimum example:

    class Test(object):
        @property
        def test(self):
            """
            Example:
                >>> ini = Test()
                >>> ini.test
                3.14
            """
            return 3.14
    
        @test.setter
        def test(self, s):
            pass
    

    The output I receive when I run xdoctest test_min.py is:

    =====================================
    _  _ ___  ____ ____ ___ ____ ____ ___
     \/  |  \ |  | |     |  |___ [__   |
    _/\_ |__/ |__| |___  |  |___ ___]  |
    
    =====================================
    
    Start doctest_module('xdoctest_min.py')
    Listing tests
    gathering tests
    running 0 test(s)
    ============
    ===  in 0.00 seconds ===
    

    If I remove the whole @test.setter method, the test succeeds properly. Any ideas on what might be going wrong here / what I'm missing?

    bug severity - minor 
    opened by trappitsch 8
  • Issue recognizing my docstring

    Issue recognizing my docstring

    For the following docstring I get an error:

    def logTraceback(logFunction):
      r''' Logs the exception traceback to the specified log function.
    
      >>> try: raise Exception()  # doctest: +ELLIPSIS
      ... except Exception: logTraceback(lambda *a, **b: sys.stdout.write(a[0] + "\n", *a[1:], **b))
      Traceback (most recent call last):
      ...
      Exception
      ...
      '''
      # here is the code
    

    Error:

    running 62 test(s)
    ====== <exec> ======
    * DOCTEST : D:\forks\HACE\autocook\autocook\base.py::logTraceback:0, line 21 <- wrt source file
    DOCTEST SOURCE
    1 >>> try: raise Exception()  # doctest: +ELLIPSIS
    2 ... except Exception: logTraceback(lambda *a, **b: sys.stdout.write(a[0] + "\n", *a[1:], **b))
      Traceback (most recent call last):
      ...
      Exception
      ...
    DOCTEST STDOUT/STDERR
    
    Traceback (most recent call last):
      File "d:\apps\Miniforge3\lib\runpy.py", line 194, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "d:\apps\Miniforge3\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "d:\apps\Miniforge3\lib\site-packages\xdoctest\__main__.py", line 172, in <module>
        retcode = main()
      File "d:\apps\Miniforge3\lib\site-packages\xdoctest\__main__.py", line 160, in main
        run_summary = xdoctest.doctest_module(modname, argv=[command], style=style,
      File "d:\apps\Miniforge3\lib\site-packages\xdoctest\runner.py", line 302, in doctest_module
        run_summary = _run_examples(enabled_examples, verbose, config,
      File "d:\apps\Miniforge3\lib\site-packages\xdoctest\runner.py", line 465, in _run_examples
        summary = example.run(verbose=verbose, on_error=on_error)
      File "d:\apps\Miniforge3\lib\site-packages\xdoctest\doctest_example.py", line 612, in run
        code = compile(
      File "<doctest:D:\forks\HACE\autocook\autocook\base.py::logTraceback:0>", line 2
        except Exception: logTraceback(lambda *a, **b: sys.stdout.write(a[0] + "\n", *a[1:], **b))
                                                                                                 ^
    SyntaxError: unexpected EOF while parsing
    
    bug 
    opened by ArneBachmannDLR 7
  • Fix test failure if pytest's flaky plugin is installed

    Fix test failure if pytest's flaky plugin is installed

    Disable pytest's flaky plugin in test_simple_pytest_import_error_cli in order to fix a test failure due to it mangling pytest's return code on import error.

    opened by mgorny 6
  • UnicodeDecodeError in pytest plugin active on html5lib repo

    UnicodeDecodeError in pytest plugin active on html5lib repo

    If the xdoctest plugin is active when running tests on html5lib, it fails on a .txt file which is incorrectly assumed to be utf-8.

    _______________________________________________________________________________ ERROR collecting test_stream.py ________________________________________________________________________________
    /usr/lib/python3.7/site-packages/pluggy/hooks.py:289: in __call__
        return self._hookexec(self, self.get_hookimpls(), kwargs)
    /usr/lib/python3.7/site-packages/pluggy/manager.py:87: in _hookexec
        return self._inner_hookexec(hook, methods, kwargs)
    /usr/lib/python3.7/site-packages/pluggy/manager.py:81: in <lambda>
        firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
    /usr/lib/python3.7/site-packages/_pytest/python.py:234: in pytest_pycollect_makeitem
        res = list(collector._genfunctions(name, obj))
    /usr/lib/python3.7/site-packages/_pytest/python.py:403: in _genfunctions
        self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
    /usr/lib/python3.7/site-packages/pluggy/hooks.py:327: in call_extra
        return self(**kwargs)
    /usr/lib/python3.7/site-packages/pluggy/hooks.py:289: in __call__
        return self._hookexec(self, self.get_hookimpls(), kwargs)
    /usr/lib/python3.7/site-packages/pluggy/manager.py:87: in _hookexec
        return self._inner_hookexec(hook, methods, kwargs)
    /usr/lib/python3.7/site-packages/pluggy/manager.py:81: in <lambda>
        firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
    /usr/lib/python3.7/site-packages/_pytest/python.py:129: in pytest_generate_tests
        metafunc.parametrize(*marker.args, **marker.kwargs)
    /usr/lib/python3.7/site-packages/_pytest/python.py:964: in parametrize
        function_definition=self.definition,
    /usr/lib/python3.7/site-packages/_pytest/mark/structures.py:121: in _for_parametrize
        len(param.values)
    E   TypeError: object of type 'MarkDecorator' has no len()
    ___________________________________________________________________ ERROR collecting testdata/encoding/chardet/test_big5.txt ___________________________________________________________________
    /usr/lib/python3.7/site-packages/xdoctest/plugin.py:191: in collect
        text = self.fspath.read_text(encoding)
    /usr/lib/python3.7/site-packages/py/_path/common.py:165: in read_text
        return f.read()
    codecs:322: in decode
        ???
    E   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa6 in position 0: invalid start byte
    
    bug 
    opened by jayvdb 6
  • Ignore \r\n vs \n in output

    Ignore \r\n vs \n in output

    When capturing output of a CLI, and sometimes when dealing with bytes, it is common to have a \r\n appear in a variable only if it is on Windows, and \n otherwise.

    The following should interpret \n in the expected output as a os.linesep, or to be sensible/compatible with be doctest it should be liberal and match any linesep.

    >>> 'foo\r\n'
    'foo\n'
    
    opened by jayvdb 6
  • Fails the test because of the quote style.

    Fails the test because of the quote style.

    I have simple wrapper function to the US census library:

    def state_info(state):
        """
        Given a the full name of a state, returns the corresponding abbreviation and FIPS code.
    
        Example:
    
        >>> state_info("texas")
        ("TX", "48")
        """
        abbrev = states.mapping("name", "abbr").get(state.title())
        st = states.lookup(abbrev)
        fips = st.fips
        return (abbrev, fips)
    

    However xdoctest fails because the of quoting style:

    DOCTEST PART BREAKDOWN
    Failed Part:
        2 >>> state_info("texas")
    DOCTEST TRACEBACK
    Expected:
        ("TX", "48")
    Got:
        ('TX', '48')
    Repr Difference:
        got  = "('TX', '48')"
        want = '("TX", "48")'
    

    Since the expected value matches my output, I thought the test would pass.

    opened by rgreinho 5
  • Fix Pytest 8 compatibility

    Fix Pytest 8 compatibility

    Pytest is moving away from py.path.local to pathlib.Path.

    This causes warnings when running tests on Pytest 7:

    .venv/lib/python3.10/site-packages/_pytest/nodes.py:140: 481 warnings
      /home/arjan/Development/gaphor/.venv/lib/python3.10/site-packages/_pytest/nodes.py:140: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to XDoctestModule is deprecated. Please use the (path: pathlib.Path) argument instead.
      See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
        return super().__call__(*k, **kw)
    

    See also https://docs.pytest.org/en/7.0.x/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path.

    This PR changes the pytest_collect_file function to use the pathlib path objects instead.

    bug 
    opened by amolenaar 5
  • Dynamic docstring not recognized

    Dynamic docstring not recognized

    def func() -> None:
      r''' Dynamic doctest
      >>> %s
      %s
      '''
      return
    func.__doc__ %= ('print(1)', '1')
    

    Run via xdoctest --analysis dynamic x.py fails, because xdoctest seems to use the source code, not the doctring from the import.

    opened by ArneBachmannDLR 5
  • Bump actions/setup-python from 4.3.0 to 4.4.0

    Bump actions/setup-python from 4.3.0 to 4.4.0

    Bumps actions/setup-python from 4.3.0 to 4.4.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Add support to install multiple python versions

    In scope of this release we added support to install multiple python versions. For this you can try to use this snippet:

        - uses: actions/setup-python@v4
          with:
            python-version: |
                3.8
                3.9
                3.10
    

    Besides, we changed logic with throwing the error for GHES if cache is unavailable to warn (actions/setup-python#566).

    Improve error handling and messages

    In scope of this release we added improved error message to put operating system and its version in the logs (actions/setup-python#559). Besides, the release

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Errors in tests

    Errors in tests

    =========================================================================================== ERRORS ===========================================================================================
    __________________________________________________________________ ERROR at setup of TestXDoctest.test_collect_testtextfile __________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 125
          def test_collect_testtextfile(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:125
    __________________________________________________________________ ERROR at setup of TestXDoctest.test_collect_module_empty __________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 147
          def test_collect_module_empty(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:147
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_simple_doctestfile ___________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 158
          def test_simple_doctestfile(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:158
    ______________________________________________________________________ ERROR at setup of TestXDoctest.test_new_pattern _______________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 177
          def test_new_pattern(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:177
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_multiple_patterns ____________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 190
          def test_multiple_patterns(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:190
    __________________________________________________________________ ERROR at setup of TestXDoctest.test_encoding[foo-ascii] ___________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 256
              @pytest.mark.parametrize(
                  "   test_string,    encoding",
                  [("foo", "ascii"), ("öäü", "latin1"), ("öäü", "utf-8")],
              )
              def test_encoding(self, pytester, test_string, encoding):
    E       fixture 'pytester' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:256
    _____________________________________________________________ ERROR at setup of TestXDoctest.test_encoding[\xf6\xe4\xfc-latin1] ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 256
              @pytest.mark.parametrize(
                  "   test_string,    encoding",
                  [("foo", "ascii"), ("öäü", "latin1"), ("öäü", "utf-8")],
              )
              def test_encoding(self, pytester, test_string, encoding):
    E       fixture 'pytester' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:256
    ______________________________________________________________ ERROR at setup of TestXDoctest.test_encoding[\xf6\xe4\xfc-utf-8] ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 256
              @pytest.mark.parametrize(
                  "   test_string,    encoding",
                  [("foo", "ascii"), ("öäü", "latin1"), ("öäü", "utf-8")],
              )
              def test_encoding(self, pytester, test_string, encoding):
    E       fixture 'pytester' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:256
    ____________________________________________________________________ ERROR at setup of TestXDoctest.test_xdoctest_options ____________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 283
          def test_xdoctest_options(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:283
    ______________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_unexpected_exception ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 305
          def test_doctest_unexpected_exception(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:305
    ________________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_property_lineno _________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 349
          def test_doctest_property_lineno(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:349
    ____________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_property_lineno_freeform ____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 379
          def test_doctest_property_lineno_freeform(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:379
    _____________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_property_lineno_google _____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 412
          def test_doctest_property_lineno_google(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:412
    ___________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_property_lineno_google_v2 ____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 445
          def test_doctest_property_lineno_google_v2(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:445
    _____________________________________________________________ ERROR at setup of TestXDoctest.test_docstring_show_entire_doctest ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 480
          def test_docstring_show_entire_doctest(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:480
    ___________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_unex_importerror_only_txt ____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 535
          def test_doctest_unex_importerror_only_txt(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:535
    __________________________________________________________ ERROR at setup of TestXDoctest.test_doctest_unex_importerror_with_module __________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 550
          def test_doctest_unex_importerror_with_module(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:550
    ____________________________________________________________________ ERROR at setup of TestXDoctest.test_txtfile_failing _____________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 632
          def test_txtfile_failing(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:632
    _________________________________________________________________ ERROR at setup of TestXDoctest.test_txtfile_with_fixtures __________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 655
          def test_txtfile_with_fixtures(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:655
    ____________________________________________________________ ERROR at setup of TestXDoctest.test_txtfile_with_usefixtures_in_ini _____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 668
          def test_txtfile_with_usefixtures_in_ini(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:668
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_ignored_whitespace ___________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 692
          def test_ignored_whitespace(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:692
    ________________________________________________________________ ERROR at setup of TestXDoctest.test_ignored_whitespace_glob _________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 709
          def test_ignored_whitespace_glob(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:709
    ____________________________________________________________________ ERROR at setup of TestXDoctest.test_contains_unicode ____________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 722
          def test_contains_unicode(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:722
    ________________________________________________________________ ERROR at setup of TestXDoctest.test_junit_report_for_doctest ________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 741
          def test_junit_report_for_doctest(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:741
    _________________________________________________________________ ERROR at setup of TestXDoctest.test_unicode_doctest_module _________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 757
          def test_unicode_doctest_module(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:757
    ________________________________________________________________ ERROR at setup of TestXDoctest.test_xdoctest_multiline_list _________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 779
          def test_xdoctest_multiline_list(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:779
    _______________________________________________________________ ERROR at setup of TestXDoctest.test_xdoctest_multiline_string ________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 794
          def test_xdoctest_multiline_string(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:794
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_xdoctest_trycatch ____________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 828
          def test_xdoctest_trycatch(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:828
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_xdoctest_functions ___________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 859
          def test_xdoctest_functions(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:859
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_stdout_capture_no ____________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 882
          def test_stdout_capture_no(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:882
    ___________________________________________________________________ ERROR at setup of TestXDoctest.test_stdout_capture_yes ___________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 908
          def test_stdout_capture_yes(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:908
    ________________________________________________________________ ERROR at setup of TestXDoctestModuleLevel.test_doctestmodule ________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 932
          def test_doctestmodule(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:932
    __________________________________________________ ERROR at setup of TestXDoctestModuleLevel.test_collect_module_single_modulelevel_doctest __________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 957
          def test_collect_module_single_modulelevel_doctest(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:957
    _________________________________________________ ERROR at setup of TestXDoctestModuleLevel.test_collect_module_two_doctest_one_modulelevel __________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 976
          def test_collect_module_two_doctest_one_modulelevel(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:976
    __________________________________________________ ERROR at setup of TestXDoctestModuleLevel.test_collect_module_two_doctest_no_modulelevel __________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 990
          def test_collect_module_two_doctest_no_modulelevel(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:990
    ______________________________________________________________ ERROR at setup of TestXDoctestSkips.test_xdoctest_skips_diabled _______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1128
          def test_xdoctest_skips_diabled(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1128
    _____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_one_skipped_passed[text] ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1158
          def test_one_skipped_passed(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1158
    ____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_one_skipped_passed[module] _____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1158
          def test_one_skipped_passed(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1158
    _____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_one_skipped_failed[text] ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1172
          def test_one_skipped_failed(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1172
    ____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_one_skipped_failed[module] _____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1172
          def test_one_skipped_failed(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1172
    _________________________________________________________________ ERROR at setup of TestXDoctestSkips.test_all_skipped[text] _________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1186
          def test_all_skipped(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1186
    ________________________________________________________________ ERROR at setup of TestXDoctestSkips.test_all_skipped[module] ________________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1186
          def test_all_skipped(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1186
    _____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_all_skipped_global[text] ______________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1203
          def test_all_skipped_global(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1203
    ____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_all_skipped_global[module] _____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1203
          def test_all_skipped_global(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1203
    _____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_vacuous_all_skipped[text] _____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1219
          def test_vacuous_all_skipped(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1219
    ____________________________________________________________ ERROR at setup of TestXDoctestSkips.test_vacuous_all_skipped[module] ____________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1219
          def test_vacuous_all_skipped(self, testdir, makedoctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, makedoctest, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1219
    _____________________________________________________ ERROR at setup of TestXDoctestAutoUseFixtures.test_doctest_module_session_fixture ______________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1229
          def test_doctest_module_session_fixture(self, testdir):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1229
    _______________________________________________________ ERROR at setup of TestXDoctestAutoUseFixtures.test_fixture_scopes[True-module] _______________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1261
          @pytest.mark.parametrize('scope', SCOPES)
          @pytest.mark.parametrize('enable_doctest', [True, False])
          def test_fixture_scopes(self, testdir, scope, enable_doctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1261
    ______________________________________________________ ERROR at setup of TestXDoctestAutoUseFixtures.test_fixture_scopes[True-session] _______________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1261
          @pytest.mark.parametrize('scope', SCOPES)
          @pytest.mark.parametrize('enable_doctest', [True, False])
          def test_fixture_scopes(self, testdir, scope, enable_doctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1261
    _______________________________________________________ ERROR at setup of TestXDoctestAutoUseFixtures.test_fixture_scopes[True-class] ________________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1261
          @pytest.mark.parametrize('scope', SCOPES)
          @pytest.mark.parametrize('enable_doctest', [True, False])
          def test_fixture_scopes(self, testdir, scope, enable_doctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1261
    ______________________________________________________ ERROR at setup of TestXDoctestAutoUseFixtures.test_fixture_scopes[True-function] ______________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1261
          @pytest.mark.parametrize('scope', SCOPES)
          @pytest.mark.parametrize('enable_doctest', [True, False])
          def test_fixture_scopes(self, testdir, scope, enable_doctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py:1261
    ______________________________________________________ ERROR at setup of TestXDoctestAutoUseFixtures.test_fixture_scopes[False-module] _______________________________________________________
    file /disk-samsung/freebsd-ports/devel/py-xdoctest/work-py39/xdoctest-1.0.1/tests/test_plugin.py, line 1261
          @pytest.mark.parametrize('scope', SCOPES)
          @pytest.mark.parametrize('enable_doctest', [True, False])
          def test_fixture_scopes(self, testdir, scope, enable_doctest):
    E       fixture 'testdir' not found
    >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id, xdoctest_namespace
    >       use 'pytest --fixtures [testpath]' for help on them.
    
    

    Version: 1.0.1 FreeBSD 13.1

    opened by yurivict 11
  • Add Lark backend

    Add Lark backend

    A Lark backend allows us to have a well defined grammar for parsing docstrings and extracting doctests.

    It might not be faster than the current whatever-i-did-to-get-it-working approach. But mine may have edge cases that a proper grammar would not.

    Something like:

    start? docstring
    doctest: indented(python, '>>>')
    example_item: doctest
    example_items: list(example_item)
    args: "Args: " indented(args_items)
    example: "Example: " indented(example_items)
    ignore: "Ignore: " indented(text)
    dockblock: args | example | ignore | benchmark | misc
    docstring: text | docblock
    
    enhancement 
    opened by Erotemic 0
  • Support await expressions at the top level, like in asyncio REPL

    Support await expressions at the top level, like in asyncio REPL

    One often needs to invoke async callables in doctests:

    >>> async def foo(): ...
    >>> await foo()
    

    Currently, this is not allowed because an await anywhere but inside an async function is a syntax error.

    One commonly suggested solution is to use asyncio.run:

    >>> async def foo(): ...
    >>> asyncio.run(foo())
    

    This approach is rarely useful, however, because asyncio.run() will terminate the event loop and finalize all coroutines at exit, which makes it impossible to persist state across invocations (which makes this solution mostly useless except for the most trivial use cases).

    Since recently there is an asyncio REPL available that allows top-level await; it can be invoked simply as python -m asyncio. It is desirable to support this syntax in doctests, too.

    enhancement help wanted 
    opened by pavel-kirienko 1
  • Pickling functions defined in doctests fail

    Pickling functions defined in doctests fail

    New ubelt futures test failed when trying to run in xdoctest:

        >>> # xdoctest: +SKIP
        >>> # Note: while this works in IPython, this does not work when running
        >>> # in xdoctest. 
        >>> # xdoctest: +REQUIRES(module:timerit)
        >>> # Does my function benefit from parallelism?
        >>> def my_function(arg1, arg2):
        ...     return (arg1 + arg2) * 3
        >>> #
        >>> def run_process(inputs, mode='serial', max_workers=0):
        ...     from concurrent.futures import as_completed
        ...     import ubelt as ub
        ...     # The executor interface is the same regardless of modes
        ...     executor = ub.Executor(mode=mode, max_workers=max_workers)
        ...     # submit returns a Future object
        ...     jobs = [executor.submit(my_function, *args) for args in inputs]
        ...     # future objects will contain results when they are done
        ...     results = [job.result() for job in as_completed(jobs)]
        ...     return results
        >>> # The same code tests our method in serial, thread, or process mode
        >>> import timerit
        >>> ti = timerit.Timerit(100, bestof=10, verbose=2)
        >>> # Setup test data
        >>> import random
        >>> rng = random.Random(0)
        >>> max_workers = 4
        >>> inputs = [(rng.random(), rng.random()) for _ in range(100)]
        >>> for mode in ['serial', 'process', 'thread']:
        >>>     for timer in ti.reset('mode={} max_workers={}'.format(mode, max_workers)):
        >>>         with timer:
        >>>             run_process(inputs, mode=mode, max_workers=max_workers)
        >>> print(ub.repr2(ti))
    

    Error is:

        DOCTEST TRACEBACK
        concurrent.futures.process._RemoteTraceback: 
        """
        Traceback (most recent call last):
          File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/multiprocessing/queues.py", line 239, in _feed
            obj = _ForkingPickler.dumps(obj)
          File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/multiprocessing/reduction.py", line 51, in dumps
            cls(buf, protocol).dump(obj)
        _pickle.PicklingError: Can't pickle <function my_function at 0x7f7f27f5e430>: attribute lookup my_function on ubelt.util_futures failed
        """
        
        
        The above exception was the direct cause of the following exception:
        
        
        Traceback (most recent call last):
        
          File "<doctest:/home/joncrall/code/ubelt/ubelt/util_futures.py::__doc__:0>", line rel: 27, abs: 37, in <module>
            >>>             run_process(inputs, mode=mode, max_workers=max_workers)
        
          File "<doctest:/home/joncrall/code/ubelt/ubelt/util_futures.py::__doc__:0>", line rel: 14, abs: 24, in run_process
            ...     results = [job.result() for job in as_completed(jobs)]
        
          File "<doctest:/home/joncrall/code/ubelt/ubelt/util_futures.py::__doc__:0>", line rel: 14, abs: 24, in <listcomp>
            ...     results = [job.result() for job in as_completed(jobs)]
        
          File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/concurrent/futures/_base.py", line 432, in result
            return self.__get_result()
        
          File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
            raise self._exception
        
          File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/multiprocessing/queues.py", line 239, in _feed
            obj = _ForkingPickler.dumps(obj)
        
          File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/multiprocessing/reduction.py", line 51, in dumps
            cls(buf, protocol).dump(obj)
        
        _pickle.PicklingError: Can't pickle <function my_function at 0x7f7f27f5e430>: attribute lookup my_function on ubelt.util_futures failed
        DOCTEST REPRODUCTION
        CommandLine:
            python -m xdoctest /home/joncrall/code/ubelt/ubelt/util_futures.py __doc__:0
    
    === Failed tests ===
    python -m xdoctest /home/joncrall/code/ubelt/ubelt/util_futures.py __doc__:0
    === 1 failed, 6 passed in 0.14 seconds ===
    ^CError in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "/home/joncrall/.pyenv/versions/3.8.6/lib/python3.8/concurrent/futures/process.py", line 104, in _python_exit
    Process ForkProcess-4:
    Process ForkProcess-2:
    Process ForkProcess-1:
    Process ForkProcess-3:
    
    opened by Erotemic 1
Releases(v1.1.0)
  • v1.1.0(Sep 5, 2022)

    Fixed

    • Can now handle basic versions of the new __editable__ package finder mechanism.
    • Parsing bug where directives were incorrectly flagged as inline if they were directly followed by a function with a decorator.

    Removed

    • Dropped 2.7 and 3.5 support. Now supporting 3.6+ Use xdoctest<=1.0.2 for 2.7 or 3.5 support.

    Changed

    • Improved the "dump" functionality of converting doctests to unit tests.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Aug 19, 2022)

    Added

    • Environs as options: XDOCTEST_VERBOSE, XDOCTEST_OPTIONS, XDOCTEST_GLOBAL_EXEC, XDOCTEST_REPORT, XDOCTEST_STYLE, and XDOCTEST_ANALYSIS environment variables can now be used to specify configuration defaults.

    Changed

    • Added experimental hidden feature --insert-skip-directive-above-failures that can be used to modify your code such that failing doctests are marked as skip.
    • Disabled traceback suppression on module import errors (this is is configurable via the "supress_import_errors" option).
    • Xdoctest will no longer try to pre-import the module if none of its doctests have any enabled lines. This also means global-exec statements will NOT run for those tests, which means you can no longer use global-exec to force enabling tests.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Jul 11, 2022)

    Added

    • Add type stubs
    • Basic support for pyproject.toml under tool.xdoctest. Currently only supports options in the native runner.

    Fixed

    • Corner case bug in error reporting
    • Doctests that never run any code are now correctly marked as skipped
    • Issue where the "dumps" command was undocumented and has an error.

    Changed

    • Moved some globals into a new module called global_state and allowed environs to enable debug print statements.
    • Added util_deprecation module to robustly mark features as deprecated.
    • Modified the google style return type parser to return a type if the only content is some parsable python code.
    • Modified docscrape google to allow for parsing of *args and **kwargs in args blocks. This has also moved to the standalone package googledoc
    • Overhaul of repo structure in an effort to modernize and to agree with templates defined by xcookie
    • Module code now lives in the "src" directory to remove install vs develop ambiguity.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Mar 25, 2022)

    There is nothing too special functionality-wise about this 1.0 release, except that xdoctest has been in a 1.0 state for a long time. It is now widely used, and it deserves to be marked as the mature and stable library that it is.

    Added

    • Support for Python 3.10

    Fixed

    • Warning in pytest8 (thanks @amolenaar)
    • Spelling errors in documentation
    Source code(tar.gz)
    Source code(zip)
  • v0.15.10(Oct 6, 2021)

    Version 0.15.10 - Released 2021-10-06

    Changed

    • The xdoctest "analysis" option now defaults to "auto" everywhere.

    Fixed

    • Fix issue #112 --analysis=dynamic argument is now respected
    Source code(tar.gz)
    Source code(zip)
  • 0.15.9(Sep 24, 2021)

    Changed

    • Added GitHub actions to the CI
    • Disabled workaround 16806 in Python 3.8+
    • New CI GPG Keys: Erotemic-CI: 70858F4D01314BF21427676F3D568E6559A34380 for reference the old signing key was 98007794ED130347559354B1109AC852D297D757.

    Fixed

    • Fixed minor test failures
    • Fixed #106 - an issue to do with compiling multiline statements in single mode.
    • Fixed #108 - an issue to do with compiling semicolon token in eval mode.
    Source code(tar.gz)
    Source code(zip)
  • 0.15.8(Sep 2, 2021)

    Version 0.15.8 - Released 2021-09-02

    Changed

    • Removed the distracting and very long internal traceback that occurred in pytest when a module errors while it is being imported before the doctest is run.
    • Pytest now defaults to --xdoctest-verbose=2 by default (note this does nothing unless -s is also given so pytest does not supress output)
    Source code(tar.gz)
    Source code(zip)
  • 0.15.7(Sep 2, 2021)

  • 0.15.6(Aug 8, 2021)

    Changed

    • Directive syntax errors are now handled as doctest runtime errors and return better debugging information.
    • README and docs were improved
    Source code(tar.gz)
    Source code(zip)
  • 0.15.5(Jun 28, 2021)

    Version 0.15.5 - Released 2021-06-27

    Changed

    • Better message when a pytest skip or exit-test-exception occurs

    Fixed

    • Suppressed warning about using internal FixtureRequest
    Source code(tar.gz)
    Source code(zip)
Owner
Jon Crall
Staff R&D Engineer; Open Source Enthusiast
Jon Crall
pytest plugin providing a function to check if pytest is running.

pytest-is-running pytest plugin providing a function to check if pytest is running. Installation Install with: python -m pip install pytest-is-running

Adam Johnson 21 Nov 1, 2022
Pytest-typechecker - Pytest plugin to test how type checkers respond to code

pytest-typechecker this is a plugin for pytest that allows you to create tests t

vivax 2 Aug 20, 2022
A pytest plugin to run an ansible collection's unit tests with pytest.

pytest-ansible-units An experimental pytest plugin to run an ansible collection's unit tests with pytest. Description pytest-ansible-units is a pytest

Community managed Ansible repositories 9 Dec 9, 2022
ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries.

ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries. With this f

Mustafa 1 Jul 11, 2022
Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report

pytest-ui-automatic Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report How to run Run tests execute_test

moyu6027 11 Nov 8, 2022
pytest splinter and selenium integration for anyone interested in browser interaction in tests

Splinter plugin for the pytest runner Install pytest-splinter pip install pytest-splinter Features The plugin provides a set of fixtures to use splin

pytest-dev 238 Nov 14, 2022
A Django plugin for pytest.

Welcome to pytest-django! pytest-django allows you to test your Django project/applications with the pytest testing tool. Quick start / tutorial Chang

pytest-dev 1.1k Dec 31, 2022
A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax

1.0 Release See here for details about breaking changes with the upcoming 1.0 release: https://github.com/taverntesting/tavern/issues/495 Easier API t

null 909 Dec 15, 2022
Coverage plugin for pytest.

Overview docs tests package This plugin produces coverage reports. Compared to just using coverage run this plugin does some extras: Subprocess suppor

pytest-dev 1.4k Dec 29, 2022
pytest plugin for distributed testing and loop-on-failures testing modes.

xdist: pytest distributed testing plugin The pytest-xdist plugin extends pytest with some unique test execution modes: test run parallelization: if yo

pytest-dev 1.1k Dec 30, 2022
Plugin for generating HTML reports for pytest results

pytest-html pytest-html is a plugin for pytest that generates a HTML report for test results. Resources Documentation Release Notes Issue Tracker Code

pytest-dev 548 Dec 28, 2022
Mypy static type checker plugin for Pytest

pytest-mypy Mypy static type checker plugin for pytest Features Runs the mypy static type checker on your source files as part of your pytest test run

Dan Bader 218 Jan 3, 2023
:game_die: Pytest plugin to randomly order tests and control random.seed

pytest-randomly Pytest plugin to randomly order tests and control random.seed. Features All of these features are on by default but can be disabled wi

pytest-dev 471 Dec 30, 2022
pytest plugin for manipulating test data directories and files

pytest-datadir pytest plugin for manipulating test data directories and files. Usage pytest-datadir will look up for a directory with the name of your

Gabriel Reis 191 Dec 21, 2022
pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files

pytest-play pytest-play is a codeless, generic, pluggable and extensible automation tool, not necessarily test automation only, based on the fantastic

pytest-dev 67 Dec 1, 2022
pytest plugin for a better developer experience when working with the PyTorch test suite

pytest-pytorch What is it? pytest-pytorch is a lightweight pytest-plugin that enhances the developer experience when working with the PyTorch test sui

Quansight 39 Nov 18, 2022
Pytest plugin for testing the idempotency of a function.

pytest-idempotent Pytest plugin for testing the idempotency of a function. Usage pip install pytest-idempotent Documentation Suppose we had the follo

Tyler Yep 3 Dec 14, 2022
A pytest plugin, that enables you to test your code that relies on a running PostgreSQL Database

This is a pytest plugin, that enables you to test your code that relies on a running PostgreSQL Database. It allows you to specify fixtures for PostgreSQL process and client.

Clearcode 252 Dec 21, 2022
A pytest plugin that enables you to test your code that relies on a running Elasticsearch search engine

pytest-elasticsearch What is this? This is a pytest plugin that enables you to test your code that relies on a running Elasticsearch search engine. It

Clearcode 65 Nov 10, 2022