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

Add marks to remove the need for commenting/uncommenting pytest.ini #1

Open
IronEddy418 opened this issue Jul 4, 2022 · 0 comments

Comments

@IronEddy418
Copy link

Hey Jim! Really appreciate your work here on ML Testing - starting to learn about the MLOps world myself and there isn't much out there yet.

Regarding:

To run the tests in pipeline-tests or notebook-tests, uncomment them in pytest.ini and then re-run:

python3 -m pytest

You can use pytest marks to make this nicer for users of the repo (https://docs.pytest.org/en/7.1.x/how-to/mark.html, https://docs.pytest.org/en/7.1.x/example/markers.html)

Add this to your pytest.ini file:

markers =
    unit
    pipeline
    notebook

and then add an attribute to the unit tests like so:

@pytest.mark.unit or @pytest.mark.pipeline

and to then run tests you can do pytest -m unit or pytest -m pipeline. Saves having to edit files!

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

1 participant