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

Conda tests session should skip rather than fail if conda not installed #520

Closed
FollowTheProcess opened this issue Dec 22, 2021 · 4 comments · Fixed by #521
Closed

Conda tests session should skip rather than fail if conda not installed #520

FollowTheProcess opened this issue Dec 22, 2021 · 4 comments · Fixed by #521

Comments

@FollowTheProcess
Copy link
Collaborator

Describe the bug

While quickly doing #519, I noticed that running bare nox on my machine results in somewhat unattractive looking failures:

image

I think a better solution would be to first check if the user has conda and skip this session if not (much like the tests themselves have a pytest.mark.skipif condition.

How to reproduce

Run nox on this project without having conda installed.

Expected behavior

Should skip conda_tests if conda is not installed.

This is a super quick fix and I'll do it now, filing the issue for traceability 🙂

@DiddiLeija
Copy link
Collaborator

I can reproduce this using Windows. I think skipping conda_tests could be useful. Actually, we can add something to nox.session to add a conditional to skip sessions?

@FollowTheProcess
Copy link
Collaborator Author

@DiddiLeija Yeah potentially, something like

if <something that would render the session useless>:
    session.skip(reason="Missing something needed for the session")

Kind of like pytest's mark.skipif.

I think this could be a bit complex to implement though and might be better served with the simple nox.options.sessions filter?

@DiddiLeija
Copy link
Collaborator

something like

if <something that would render the session useless>:
    session.skip(reason="Missing something needed for the session")

Kind of like pytest's mark.skipif.

Yup. I'm looking for something like that.

I think this could be a bit complex to implement though and might be better served with the simple nox.options.sessions filter?

I will take a closer look for this idea later, probably next year.

@FollowTheProcess
Copy link
Collaborator Author

@DiddiLeija I've just found out session.skip is already a thing!

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

Successfully merging a pull request may close this issue.

2 participants