$ pytest unit_test --run-podman
Traceback (most recent call last):
File "/Users/joerick/Projects/cibuildwheel/env/bin/pytest", line 8, in <module>
sys.exit(console_main())
...snip...
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1143, in pytest_load_initial_conftests
self.pluginmanager._set_initial_conftests(
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 566, in _set_initial_conftests
self._try_load_conftest(anchor, namespace.importmode, rootpath)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 583, in _try_load_conftest
self._getconftestmodules(anchor, importmode, rootpath)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 612, in _getconftestmodules
mod = self._importconftest(conftestpath, importmode, rootpath)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 660, in _importconftest
self.consider_conftest(mod)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 742, in consider_conftest
self.register(conftestmodule, name=conftestmodule.__file__)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/__init__.py", line 488, in register
ret: Optional[str] = super().register(plugin, name)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/pluggy/_manager.py", line 115, in register
hook._maybe_apply_history(hookimpl)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/pluggy/_hooks.py", line 300, in _maybe_apply_history
res = self._hookexec(self.name, [method], kwargs, False)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/Users/joerick/Projects/cibuildwheel/test/conftest.py", line 10, in pytest_addoption
parser.addoption("--run-podman", action="store_true", default=False, help="run podman tests")
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/argparsing.py", line 104, in addoption
self._anonymous.addoption(*opts, **attrs)
File "/Users/joerick/Projects/cibuildwheel/env/lib/python3.9/site-packages/_pytest/config/argparsing.py", line 385, in addoption
raise ValueError("option names %s already added" % conflict)
ValueError: option names {'--run-podman'} already added
Is this an issue in our configuration, or a bug? Should we no longer use testpaths to list all the test suites?
In cibuildwheel, we have two test suites - the unit tests at
/unit_testand the integration test suite at/test. Both/unit_testand/testare listed in testpaths-pyproject.toml
We then run either
unit_testortestusingpytest unit_test/pytest test.Each
unit_test/testdir contains a conftest.py file, which adds some options usingparser.addoption. One option that is common to both test suites is--run-podman. Before 7.3.2, this setup seemed to work, we could run both unit tests and integration tests without issue. But on 7.3.2 (perhaps since #10988?) we get the following error:Is this an issue in our configuration, or a bug? Should we no longer use testpaths to list all the test suites?
pip list output
Xref pypa/cibuildwheel#1518