Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1b51497
[WIP] Update warning stacklevel when wrapping warnings.warn
crazymerlyn Oct 18, 2018
cdd0e18
Emulate resetting the warnings registry for python 2.x
asottile Oct 18, 2018
ac57042
Improve error message when it is not possible to determine a function…
nicoddemus Oct 18, 2018
61080da
Merge pull request #4192 from asottile/fix_recwarn_stacklevel
asottile Oct 18, 2018
1803521
Use safe_str() to format warning message about unicode in Python 2
nicoddemus Oct 18, 2018
864d7fe
Add back some {posargs} placeholders for pytest invocations in tox.ini
nicoddemus Oct 19, 2018
dc0b4ef
Merge pull request #4196 from nicoddemus/better-signature-error-msg-4026
asottile Oct 19, 2018
11ff14b
Upgrade pre-commit/pre-commit-hooks to 2.0.0
asottile Oct 19, 2018
0fc1801
Update tmpdir.rst
ykantor Oct 19, 2018
366b883
Merge pull request #4200 from asottile/upgrade_hooks
RonnyPfannschmidt Oct 19, 2018
2abd005
Merge pull request #4195 from nicoddemus/issue-3691
nicoddemus Oct 19, 2018
dde1476
Fix linting
nicoddemus Oct 19, 2018
c54cdd0
Merge pull request #4201 from ykantor/patch-1
nicoddemus Oct 19, 2018
51d358a
fix typo in tmpdir documentation
Oct 19, 2018
b0eed7b
Merge pull request #4205 from vbarbaresi/fix_typo
nicoddemus Oct 19, 2018
db106d6
Fix logging usage in hooks pytest_sessionstart/finish #3340
Oct 19, 2018
02ae7d8
Improve error message when a recursive dependency between fixtures is…
nicoddemus Oct 20, 2018
6b12699
Remove pytest.config example from skipping at module level docs
nicoddemus Oct 20, 2018
b9990f7
Merge pull request #4204 from vbarbaresi/3340_log_hooks
nicoddemus Oct 20, 2018
cd72e23
Merge pull request #4207 from nicoddemus/recursive-dep-fixtures
crazymerlyn Oct 20, 2018
c94b2b2
Merge pull request #4208 from nicoddemus/pytestskip-docs-4206
asottile Oct 21, 2018
cb39bd0
Fixes for flake8 master
asottile Oct 22, 2018
771e860
Preparing release version 3.9.2
nicoddemus Oct 22, 2018
fc0f89a
Merge pull request #4215 from nicoddemus/release-3.9.2
nicoddemus Oct 23, 2018
799b72c
Merge pull request #4213 from asottile/flake8_master_fixes
asottile Oct 23, 2018
fadac0f
Fix "Plugin already registered" error with symlinks
blueyed Oct 22, 2018
0dd8515
Add reference to ``empty_parameter_set_mark`` parametrize doc
Oct 23, 2018
72d98a7
Merge pull request #4214 from blueyed/fix-4174
nicoddemus Oct 23, 2018
8bced74
Merge pull request #4220 from anpr/doc_raise_on_empty_parameterset
nicoddemus Oct 23, 2018
28dbffd
Attempt to fix macosx build setup
nicoddemus Oct 23, 2018
9df1b03
Merge pull request #4217 from nicoddemus/fix-macos-py37-travis
blueyed Oct 24, 2018
eee8201
Merge remote-tracking branch 'origin/master' into merge-master
blueyed Oct 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
additional_dependencies: [black==18.9b0]
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0-1
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
env: TOXENV=py37
before_install:
- brew update
# remove c++ include files because upgrading python as of 2018-10-23, also
# attempts to upgrade gcc, and it fails because the include files already
# exist. removing the include files is one of the solutions recommended by brew
# this workaround might not be necessary in the future
- rm '/usr/local/include/c++'
- brew upgrade python
- brew unlink python
- brew link python
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,37 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 3.9.2 (2018-10-22)
=========================

Bug Fixes
---------

- `#2909 <https://github.com/pytest-dev/pytest/issues/2909>`_: Improve error message when a recursive dependency between fixtures is detected.


- `#3340 <https://github.com/pytest-dev/pytest/issues/3340>`_: Fix logging messages not shown in hooks ``pytest_sessionstart()`` and ``pytest_sessionfinish()``.


- `#3533 <https://github.com/pytest-dev/pytest/issues/3533>`_: Fix unescaped XML raw objects in JUnit report for skipped tests


- `#3691 <https://github.com/pytest-dev/pytest/issues/3691>`_: Python 2: safely format warning message about passing unicode strings to ``warnings.warn``, which may cause
surprising ``MemoryError`` exception when monkey patching ``warnings.warn`` itself.


- `#4026 <https://github.com/pytest-dev/pytest/issues/4026>`_: Improve error message when it is not possible to determine a function's signature.


- `#4177 <https://github.com/pytest-dev/pytest/issues/4177>`_: Pin ``setuptools>=40.0`` to support ``py_modules`` in ``setup.cfg``


- `#4179 <https://github.com/pytest-dev/pytest/issues/4179>`_: Restore the tmpdir behaviour of symlinking the current test run.


- `#4192 <https://github.com/pytest-dev/pytest/issues/4192>`_: Fix filename reported by ``warnings.warn`` when using ``recwarn`` under python2.


pytest 3.9.1 (2018-10-16)
=========================

Expand Down
1 change: 0 additions & 1 deletion changelog/3533.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions changelog/3851.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add reference to ``empty_parameter_set_mark`` ini option in documentation of ``@pytest.mark.parametrize``
1 change: 1 addition & 0 deletions changelog/4174.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix "ValueError: Plugin already registered" with conftest plugins via symlink.
1 change: 0 additions & 1 deletion changelog/4177.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4179.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-3.9.2
release-3.9.1
release-3.9.0
release-3.8.2
Expand Down
23 changes: 23 additions & 0 deletions doc/en/announce/release-3.9.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pytest-3.9.2
=======================================

pytest 3.9.2 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

pip install --upgrade pytest

The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.

Thanks to all who contributed to this release, among them:

* Ankit Goel
* Anthony Sottile
* Bruno Oliveira
* Ronny Pfannschmidt
* Vincent Barbaresi
* ykantor


Happy testing,
The pytest Development Team
16 changes: 8 additions & 8 deletions doc/en/example/markers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can then restrict a test run to only run tests marked with ``webtest``::

$ pytest -v -m webtest
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 4 items / 3 deselected
Expand All @@ -44,7 +44,7 @@ Or the inverse, running all tests except the webtest ones::

$ pytest -v -m "not webtest"
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 4 items / 1 deselected
Expand All @@ -64,7 +64,7 @@ tests based on their module, class, method, or function name::

$ pytest -v test_server.py::TestClass::test_method
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 1 item
Expand All @@ -77,7 +77,7 @@ You can also select on the class::

$ pytest -v test_server.py::TestClass
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 1 item
Expand All @@ -90,7 +90,7 @@ Or select multiple nodes::

$ pytest -v test_server.py::TestClass test_server.py::test_send_http
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 2 items
Expand Down Expand Up @@ -128,7 +128,7 @@ select tests based on their names::

$ pytest -v -k http # running with the above defined example module
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 4 items / 3 deselected
Expand All @@ -141,7 +141,7 @@ And you can also run all tests except the ones that match the keyword::

$ pytest -k "not send_http" -v
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 4 items / 1 deselected
Expand All @@ -156,7 +156,7 @@ Or to select "http" and "quick" tests::

$ pytest -k "http or quick" -v
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 4 items / 2 deselected
Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/nonpython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ consulted when reporting in ``verbose`` mode::

nonpython $ pytest -v
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
collecting ... collected 2 items
Expand Down
5 changes: 2 additions & 3 deletions doc/en/example/py2py3/test_py2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

def test_exception_syntax():
try:
0/0
0 / 0
except ZeroDivisionError, e:
pass
assert e
2 changes: 1 addition & 1 deletion doc/en/example/py2py3/test_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ def test_exception_syntax():
try:
0 / 0
except ZeroDivisionError as e:
pass
assert e
2 changes: 1 addition & 1 deletion doc/en/example/simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ which will add info only when run with "--v"::

$ pytest -v
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
info1: did you know that ...
did you?
Expand Down
6 changes: 3 additions & 3 deletions doc/en/fixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ Running this test will *skip* the invocation of ``data_set`` with value ``2``::

$ pytest test_fixture_marks.py -v
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 3 items
Expand Down Expand Up @@ -775,7 +775,7 @@ Here we declare an ``app`` fixture which receives the previously defined

$ pytest -v test_appsetup.py
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 2 items
Expand Down Expand Up @@ -844,7 +844,7 @@ Let's run the tests in verbose mode and with looking at the print-output::

$ pytest -v -s test_module.py
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
cachedir: .pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 8 items
Expand Down
4 changes: 4 additions & 0 deletions doc/en/parametrize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ Let's run this::
The one parameter set which caused a failure previously now
shows up as an "xfailed (expected to fail)" test.

In case the values provided to ``parametrize`` result in an empty list - for
example, if they're dynamically generated by some function - the behaviour of
pytest is defined by the :confval:`empty_parameter_set_mark` option.

To get all combinations of multiple parametrized arguments you can stack
``parametrize`` decorators::

Expand Down
10 changes: 6 additions & 4 deletions doc/en/skipping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,20 @@ by calling the ``pytest.skip(reason)`` function:
if not valid_config():
pytest.skip("unsupported configuration")

The imperative method is useful when it is not possible to evaluate the skip condition
during import time.

It is also possible to skip the whole module using
``pytest.skip(reason, allow_module_level=True)`` at the module level:

.. code-block:: python

import sys
import pytest

if not pytest.config.getoption("--custom-flag"):
pytest.skip("--custom-flag is missing, skipping tests", allow_module_level=True)
if not sys.platform.startswith("win"):
pytest.skip("skipping windows-only tests", allow_module_level=True)

The imperative method is useful when it is not possible to evaluate the skip condition
during import time.

**Reference**: :ref:`pytest.mark.skip ref`

Expand Down
8 changes: 4 additions & 4 deletions doc/en/tmpdir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ The ``tmp_path`` fixture
.. versionadded:: 3.9


You can use the ``tmpdir`` fixture which will
You can use the ``tmp_path`` fixture which will
provide a temporary directory unique to the test invocation,
created in the `base temporary directory`_.

``tmpdir`` is a ``pathlib/pathlib2.Path`` object. Here is an example test usage:
``tmp_path`` is a ``pathlib/pathlib2.Path`` object. Here is an example test usage:

.. code-block:: python

Expand Down Expand Up @@ -69,10 +69,10 @@ The ``tmp_path_factory`` fixture
.. versionadded:: 3.9


The ``tmp_path_facotry`` is a session-scoped fixture which can be used
The ``tmp_path_factory`` is a session-scoped fixture which can be used
to create arbitrary temporary directories from any other fixture or test.

its intended to replace ``tmpdir_factory`` and returns :class:`pathlib.Path` instances.
It is intended to replace ``tmpdir_factory``, and returns :class:`pathlib.Path` instances.


The 'tmpdir' fixture
Expand Down
12 changes: 6 additions & 6 deletions doc/en/writing_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,17 +420,17 @@ additionally it is possible to copy examples for a example folder before running
============================= warnings summary =============================
$REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time
testdir.copy_example("test_example.py")
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.Class is deprecated, please use pytest.Class instead
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:329: RemovedInPytest4Warning: usage of Session.Class is deprecated, please use pytest.Class instead
return getattr(object, name, default)
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.File is deprecated, please use pytest.File instead
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:329: RemovedInPytest4Warning: usage of Session.File is deprecated, please use pytest.File instead
return getattr(object, name, default)
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.Function is deprecated, please use pytest.Function instead
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:329: RemovedInPytest4Warning: usage of Session.Function is deprecated, please use pytest.Function instead
return getattr(object, name, default)
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.Instance is deprecated, please use pytest.Instance instead
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:329: RemovedInPytest4Warning: usage of Session.Instance is deprecated, please use pytest.Instance instead
return getattr(object, name, default)
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.Item is deprecated, please use pytest.Item instead
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:329: RemovedInPytest4Warning: usage of Session.Item is deprecated, please use pytest.Item instead
return getattr(object, name, default)
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.Module is deprecated, please use pytest.Module instead
$PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/compat.py:329: RemovedInPytest4Warning: usage of Session.Module is deprecated, please use pytest.Module instead
return getattr(object, name, default)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
Expand Down
3 changes: 1 addition & 2 deletions src/_pytest/assertion/rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,9 @@ def run(self, mod):
setattr(node, name, new)
elif (
isinstance(field, ast.AST)
and
# Don't recurse into expressions as they can't contain
# asserts.
not isinstance(field, ast.expr)
and not isinstance(field, ast.expr)
):
nodes.append(field)

Expand Down
12 changes: 10 additions & 2 deletions src/_pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import py

import _pytest
from _pytest.outcomes import TEST_OUTCOME
from _pytest.outcomes import TEST_OUTCOME, fail
from six import text_type
import six

Expand Down Expand Up @@ -131,9 +131,17 @@ def getfuncargnames(function, is_method=False, cls=None):
# ordered mapping of parameter names to Parameter instances. This
# creates a tuple of the names of the parameters that don't have
# defaults.
try:
parameters = signature(function).parameters
except (ValueError, TypeError) as e:
fail(
"Could not determine arguments of {!r}: {}".format(function, e),
pytrace=False,
)

arg_names = tuple(
p.name
for p in signature(function).parameters.values()
for p in parameters.values()
if (
p.kind is Parameter.POSITIONAL_OR_KEYWORD
or p.kind is Parameter.KEYWORD_ONLY
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def _getconftestmodules(self, path):
# and allow users to opt into looking into the rootdir parent
# directories instead of requiring to specify confcutdir
clist = []
for parent in directory.parts():
for parent in directory.realpath().parts():
if self._confcutdir and self._confcutdir.relto(parent):
continue
conftestpath = parent.join("conftest.py")
Expand Down
15 changes: 10 additions & 5 deletions src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,14 +762,19 @@ def formatrepr(self):

if msg is None:
fm = self.request._fixturemanager
available = []
available = set()
parentid = self.request._pyfuncitem.parent.nodeid
for name, fixturedefs in fm._arg2fixturedefs.items():
faclist = list(fm._matchfactories(fixturedefs, parentid))
if faclist and name not in available:
available.append(name)
msg = "fixture %r not found" % (self.argname,)
msg += "\n available fixtures: %s" % (", ".join(sorted(available)),)
if faclist:
available.add(name)
if self.argname in available:
msg = " recursive dependency involving fixture '{}' detected".format(
self.argname
)
else:
msg = "fixture '{}' not found".format(self.argname)
msg += "\n available fixtures: {}".format(", ".join(sorted(available)))
msg += "\n use 'pytest --fixtures [testpath]' for help on them."

return FixtureLookupErrorRepr(fspath, lineno, tblines, msg, self.argname)
Expand Down
Loading