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

try to display a reasonable message if you run a bare 'pytest' command #890

Merged
merged 1 commit into from Oct 26, 2022

Conversation

antocuni
Copy link
Contributor

@antocuni antocuni commented Oct 26, 2022

The docstring says everything:

    At the moment of writing this conftest defines two new options, --dev and
    --no-fake-server, but because of how pytest works, they are available only
    if this is the "root conftest" for the test session.

    This means that if you are in the pyscriptjs directory:

    $ py.test                       # does NOT work
    $ py.test tests/integration/    # works

    This happens because there is also test py-unit directory, so in the first
    case the "root conftest" would be tests/conftest.py (which doesn't exist)
    instead of this.

    There are various workarounds, but for now we can just detect it and
    inform the user.

    Related StackOverflow answer: https://stackoverflow.com/a/51733980

The error message looks like this:
image

@marimeireles
Copy link
Member

I like it!
Thanks @antocuni.
Why is it a WIP?

@antocuni antocuni marked this pull request as ready for review October 26, 2022 15:32
@antocuni
Copy link
Contributor Author

Why is it a WIP?

because I forgot to mark it as ready 🤦‍♂️ .
Can you please approve it ?

Copy link
Member

@marimeireles marimeireles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antocuni antocuni merged commit 2d33afc into main Oct 26, 2022
@antocuni antocuni deleted the antocuni/conftest-workaround branch October 26, 2022 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants