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 basic testing for the tutorial #90

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Tabrizian
Copy link
Member

@Tabrizian Tabrizian commented May 1, 2024

import time
import unittest

from tritonserver import InferenceRequest, Model, Server
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice use of in-process Python API for testing! This is super simple and clean 🚀

rmccorm4
rmccorm4 previously approved these changes May 1, 2024

def test_max_tokens(self):
self._infer_and_verify_request(
32,
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: make 32 a local constant,

suggestion: make the model name as a parameterized test:

https://realpython.com/pytest-python-testing/#parametrization-combining-tests

https://realpython.com/pytest-python-testing/

Copy link
Member Author

Choose a reason for hiding this comment

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

parameterized doesn't work with unittest classes.

import time
import unittest

import pytest

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'pytest' is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants