Skip to content

testpaths + pyargs regression in 4.0.0 #4405

@ipmb

Description

@ipmb

I was using the following config to test specific modules, but it looks like they are now assumed to be relative paths instead of pyargs:

addopts = --pyargs
testpaths =
    module_one
    module_two

The exact error is:

ERROR: file or package not found: /path/to/cwd/module_one (missing __init__.py?)

Previously, module_one would be found on the PYTHONPATH instead of looking in the current working directory.

git bisect reports:

3137c89cf1232d5c68802cdc187354b8d9909f31 is the first bad commit
commit 3137c89cf1232d5c68802cdc187354b8d9909f31
Author: Daniel Hahler <[email protected]>
Date:   Thu Nov 8 00:54:51 2018 +0100

    Fix/improve handling of chdir with no-args and testpaths

    Fixes https://github.com/pytest-dev/pytest/issues/4332.

:040000 040000 b838be74b2381e8099fdcfe8ee11b65072583236 e10eb4bba2c6061029ac829ad9cd4c3a32ca273c M	src
:040000 040000 4710f7fa341f181287e744bbf5c4175a4bc57835 f1feab1f0c834e3a89ca914a5df7b437dce731b7 M	testing
bisect run success

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: collectionrelated to the collection phasetype: regressionindicates a problem that was introduced in a release which was working previously

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions