@@ -29,25 +29,29 @@ project/testrun-specific information.
29
29
30
30
Here is the algorithm which finds the rootdir from ``args ``:
31
31
32
- - determine the common ancestor directory for the specified ``args ``.
32
+ - determine the common ancestor directory for the specified ``args `` that are
33
+ recognised as paths that exist in the file system. If no such paths are
34
+ found, the common ancestor directory is set to the current working directory.
33
35
34
- - look for ``pytest.ini ``, ``tox.ini `` and ``setup.cfg `` files in the
35
- ancestor directory and upwards. If one is matched, it becomes the
36
- ini-file and its directory becomes the rootdir. An existing
37
- ``pytest.ini `` file will always be considered a match whereas
38
- ``tox.ini `` and ``setup.cfg `` will only match if they contain
39
- a ``[pytest] `` section.
36
+ - look for ``pytest.ini ``, ``tox.ini `` and ``setup.cfg `` files in the ancestor
37
+ directory and upwards. If one is matched, it becomes the ini-file and its
38
+ directory becomes the rootdir.
40
39
41
- - if no ini-file was found, look for ``setup.py `` upwards from
42
- the common ancestor directory to determine the ``rootdir ``.
40
+ - if no ini-file was found, look for ``setup.py `` upwards from the common
41
+ ancestor directory to determine the ``rootdir ``.
43
42
44
- - if no ini-file and no ``setup.py `` was found, use the already
45
- determined common ancestor as root directory. This allows to
46
- work with pytest in structures that are not part of a package
47
- and don't have any particular ini-file configuration.
43
+ - if no ``setup.py `` was found, look for ``pytest.ini ``, ``tox.ini `` and
44
+ ``setup.cfg `` in each of the specified ``args `` and upwards. If one is
45
+ matched, it becomes the ini-file and its directory becomes the rootdir.
48
46
49
- Note that options from multiple ini-files candidates are never merged,
50
- the first one wins (``pytest.ini `` always wins even if it does not
47
+ - if no ini-file was found, use the already determined common ancestor as root
48
+ directory. This allows to work with pytest in structures that are not part of
49
+ a package and don't have any particular ini-file configuration.
50
+
51
+ Note that an existing ``pytest.ini `` file will always be considered a match,
52
+ whereas ``tox.ini `` and ``setup.cfg `` will only match if they contain a
53
+ ``[pytest] `` section. Options from multiple ini-files candidates are never
54
+ merged - the first one wins (``pytest.ini `` always wins, even if it does not
51
55
contain a ``[pytest] `` section).
52
56
53
57
The ``config `` object will subsequently carry these attributes:
0 commit comments