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

Register custom marks to avoid unknown mark warnings #1855

Merged
merged 6 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ dependencies = [
"numpy>=1.15",
]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
markers = [
"deeprec: tests for deeprec model",
"experimental",
simonzhaoms marked this conversation as resolved.
Show resolved Hide resolved
"flaky: flaky tests that can fail unexpectedly",
"gpu: tests running on GPU",
"integration: integration tests",
"notebooks: tests for notebooks",
"sequential",
simonzhaoms marked this conversation as resolved.
Show resolved Hide resolved
"smoke: smoke tests",
"spark: tests that requires Spark",
"vw: tests for vowpal wabbit",
simonzhaoms marked this conversation as resolved.
Show resolved Hide resolved
]
9 changes: 7 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ You want to make sure that all your code works before you submit it to the repos

* It is better to create multiple small tests than one large test that checks all the code.
* Use `@pytest.fixture` to create data in your tests.
* Use the mark `@pytest.mark.gpu` if you want the test to be executed in a GPU environment. Use `@pytest.mark.spark` if you want the test to be executed in a Spark environment.
* Use `@pytest.mark.smoke` and `@pytest.mark.integration` to mark the tests as smoke tests and integration tests.
* Use the mark `@pytest.mark.gpu` if you want the test to be executed
in a GPU environment. Use `@pytest.mark.spark` if you want the test
to be executed in a Spark environment.
* Use `@pytest.mark.smoke` and `@pytest.mark.integration` to mark the
tests as smoke tests and integration tests.
* Use `@pytest.mark.notebooks` if you are testing a notebook.
* Use `@pytest.mark.deeprec` to mark the tests for deeprec model.
* Use `@pytest.mark.vw` to mark the tests for vowpal wabbit.
simonzhaoms marked this conversation as resolved.
Show resolved Hide resolved
* Avoid using `is` in the asserts, instead use the operator `==`.
* Follow the pattern `assert computation == value`, for example:
```python
Expand Down