You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project, IntelPython/dpctl, includes its test suite in the package layout, so that pytest --pyargs dpctl can be used to run the test suite.
I recently added to conftest.py (which is included in the layout) support for an option, which I tested in the editable build setting, i.e., python -m pytest dpctl/tests --myoption worked as expected.
When the package is installed, however, pytest --pyargd dpctl --myoption fails with ERROR: unrecognized arguments: --myoption.
The only work-around I could find was to copy test folder from the project checkout to a temporary directory dpctl_tests from where I
would run python -m pytest dpctl_tests --myoptions.
My understanding is that when --pyargs is used, arguments must be parsed before test discovery is attempted, and the unknown option causes the error.
Describe the solution you'd like
I would like pytest to defer erroring out on unknown option, only parse --pyargs option to determine where tests are located, and reparse options after conftests.py files are loaded.
The text was updated successfully, but these errors were encountered:
What's the problem this feature will solve?
My project, IntelPython/dpctl, includes its test suite in the package layout, so that
pytest --pyargs dpctl
can be used to run the test suite.I recently added to
conftest.py
(which is included in the layout) support for an option, which I tested in the editable build setting, i.e.,python -m pytest dpctl/tests --myoption
worked as expected.When the package is installed, however,
pytest --pyargd dpctl --myoption
fails withERROR: unrecognized arguments: --myoption
.The only work-around I could find was to copy test folder from the project checkout to a temporary directory
dpctl_tests
from where Iwould run
python -m pytest dpctl_tests --myoptions
.My understanding is that when
--pyargs
is used, arguments must be parsed before test discovery is attempted, and the unknown option causes the error.Describe the solution you'd like
I would like
pytest
to defer erroring out on unknown option, only parse--pyargs
option to determine where tests are located, and reparse options afterconftests.py
files are loaded.The text was updated successfully, but these errors were encountered: