Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest error: -n unknown #581

Closed
0-wiz-0 opened this issue Apr 30, 2024 · 2 comments
Closed

pytest error: -n unknown #581

0-wiz-0 opened this issue Apr 30, 2024 · 2 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Apr 30, 2024

I've packaged pikepdf-8.15.1 for pkgsrc and ran the self-tests, and saw:

UsageError: usage: pytest-3.12 [options] [file_or_dir] [file_or_dir] [...]
pytest-3.12: error: unrecognized arguments: -n
  inifile: /scratch/print/py-pikepdf/work/pikepdf-8.15.1/pyproject.toml
  rootdir: /scratch/print/py-pikepdf/work/pikepdf-8.15.1
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
ERROR: usage: pytest-3.12 [options] [file_or_dir] [file_or_dir] [...]
pytest-3.12: error: unrecognized arguments: -n
  inifile: /scratch/print/py-pikepdf/work/pikepdf-8.15.1/pyproject.toml
  rootdir: /scratch/print/py-pikepdf/work/pikepdf-8.15.1

The following works around the problem for me:

--- pyproject.toml.orig 2024-04-30 08:07:05.917031294 +0000
+++ pyproject.toml
@@ -92,7 +92,7 @@ exclude = '''
 '''

 [tool.cibuildwheel]
-test-command = "pytest -nauto {project}/tests"
+test-command = "pytest {project}/tests"
 test-extras = "test"
 # Reminder:
 #   build.yml sets CIBW_BUILD to select what can be built
@@ -181,7 +181,7 @@ ignore_missing_imports = true
 minversion = "6.0"
 norecursedirs = ["lib", ".pc", ".git", "venv"]
 testpaths = ["tests"]
-addopts = "-n auto"
+addopts = ""

 [tool.coverage.run]
 concurrency = ["multiprocessing"]

and the tests succeed, but I wonder if I'm missing a dependency or anything?
That's with pytest 7.4.3.

@jbarlow83
Copy link
Member

pytest-xdist is missing.
If you install pikepdf[test], this dependency and several others required only for running the test suite will be included.

@0-wiz-0
Copy link
Author

0-wiz-0 commented Apr 30, 2024

Thank you, adding that fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants