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

Command to generate example.json no longer works #51

Closed
athish-thiru opened this issue Oct 7, 2024 · 1 comment
Closed

Command to generate example.json no longer works #51

athish-thiru opened this issue Oct 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@athish-thiru
Copy link
Contributor

Current behavior

Running pytest --generate returns the following error:

ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --generate

Expected behavior

Running this command should produce an example.json file in every folder where an init file is defined

@athish-thiru athish-thiru added the bug Something isn't working label Oct 7, 2024
@lpsinger
Copy link
Member

lpsinger commented Oct 8, 2024

I suspect that you forgot to run it inside poetry shell.

This will probably fail:

$ pytest --generate
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --generate
  inifile: /Users/lpsinger/src/gcn-classic-to-json/pyproject.toml
  rootdir: /Users/lpsinger/src/gcn-classic-to-json

But this will succeed:

$ poetry shell
(gcn-classic-to-json-py3.12) % pytest --generate
============================= test session starts ==============================
platform darwin -- Python 3.12.7, pytest-8.3.1, pluggy-1.5.0
rootdir: /Users/lpsinger/src/gcn-classic-to-json
configfile: pyproject.toml
plugins: cov-5.0.0, gcn-classic-to-json-0.1.0
collected 4 items                                                              

gcn_classic_to_json/test/test_notices.py .xss                            [100%]

=================== 1 passed, 2 skipped, 1 xfailed in 0.18s ====================

As will this:

$ poetry run pytest --generate
============================= test session starts ==============================
platform darwin -- Python 3.12.7, pytest-8.3.1, pluggy-1.5.0
rootdir: /Users/lpsinger/src/gcn-classic-to-json
configfile: pyproject.toml
plugins: cov-5.0.0, gcn-classic-to-json-0.1.0
collected 4 items                                                              

gcn_classic_to_json/test/test_notices.py .xss                            [100%]

=================== 1 passed, 2 skipped, 1 xfailed in 0.18s ====================

@lpsinger lpsinger closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants