Skip to content

Commit cb754f2

Browse files
committed
changing test markers
1 parent 8e61910 commit cb754f2

File tree

8 files changed

+27
-28
lines changed

8 files changed

+27
-28
lines changed

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
python-version: ['3.10', '3.11', '3.12'] # Need to add 3.13 once we resolve outlines issues.
2020
env:
21-
GITHUB_ACTIONS: 1
21+
GITHUB_ACTION: 1
2222
steps:
2323
- uses: actions/checkout@v4
2424
- name: Install uv and set the python version

test/backends/test_huggingface.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
@pytest.fixture(scope="module")
2222
def backend():
2323
"""Shared HuggingFace backend for all tests in this module."""
24-
# TODO: find a smalle 1B model to do Alora stuff on github actions.
2524
backend = LocalHFBackend(
2625
model_id="ibm-granite/granite-3.2-8b-instruct",
2726
formatter=TemplateFormatter(model_id="ibm-granite/granite-4.0-tiny-preview"),
@@ -38,15 +37,15 @@ def session(backend):
3837
yield session
3938
session.reset()
4039

41-
@pytest.mark.llm
40+
@pytest.mark.qualitative
4241
def test_system_prompt(session):
4342
result = session.chat(
4443
"Where are we going?",
4544
model_options={ModelOption.SYSTEM_PROMPT: "Talk like a pirate."},
4645
)
4746
print(result)
4847

49-
@pytest.mark.llm
48+
@pytest.mark.qualitative
5049
def test_constraint_alora(session, backend):
5150
answer = session.instruct(
5251
"Corporate wants you to find the difference between these two strings: aaaaaaaaaa aaaaabaaaa. Be concise and don't write code to answer the question.",
@@ -64,7 +63,7 @@ def test_constraint_alora(session, backend):
6463
)
6564
assert alora_output in ["Y", "N"], alora_output
6665

67-
@pytest.mark.llm
66+
@pytest.mark.qualitative
6867
def test_constraint_lora_with_requirement(session, backend):
6968
answer = session.instruct(
7069
"Corporate wants you to find the difference between these two strings: aaaaaaaaaa aaaaabaaaa"
@@ -80,7 +79,7 @@ def test_constraint_lora_with_requirement(session, backend):
8079
assert isinstance(val_result, ValidationResult)
8180
assert str(val_result.reason) in ["Y", "N"]
8281

83-
@pytest.mark.llm
82+
@pytest.mark.qualitative
8483
def test_constraint_lora_override(session, backend):
8584
backend.default_to_constraint_checking_alora = False # type: ignore
8685
answer = session.instruct(
@@ -95,7 +94,7 @@ def test_constraint_lora_override(session, backend):
9594
assert isinstance(default_output_to_bool(str(val_result.reason)), bool)
9695
backend.default_to_constraint_checking_alora = True
9796

98-
@pytest.mark.llm
97+
@pytest.mark.qualitative
9998
def test_constraint_lora_override_does_not_override_alora(session, backend):
10099
backend.default_to_constraint_checking_alora = False # type: ignore
101100
answer = session.instruct(
@@ -112,7 +111,7 @@ def test_constraint_lora_override_does_not_override_alora(session, backend):
112111
assert str(val_result.reason) in ["Y", "N"]
113112
backend.default_to_constraint_checking_alora = True
114113

115-
@pytest.mark.llm
114+
@pytest.mark.qualitative
116115
def test_llmaj_req_does_not_use_alora(session, backend):
117116
backend.default_to_constraint_checking_alora = True # type: ignore
118117
answer = session.instruct(
@@ -128,12 +127,12 @@ def test_llmaj_req_does_not_use_alora(session, backend):
128127
assert isinstance(val_result, ValidationResult)
129128
assert str(val_result.reason) not in ["Y", "N"]
130129

131-
@pytest.mark.llm
130+
@pytest.mark.qualitative
132131
def test_instruct(session):
133132
result = session.instruct("Compute 1+1.")
134133
print(result)
135134

136-
@pytest.mark.llm
135+
@pytest.mark.qualitative
137136
def test_multiturn(session):
138137
session.instruct("Compute 1+1")
139138
beta = session.instruct(
@@ -143,7 +142,7 @@ def test_multiturn(session):
143142
words = session.instruct("Now list five English words that start with that letter.")
144143
print(words)
145144

146-
@pytest.mark.llm
145+
@pytest.mark.qualitative
147146
def test_format(session):
148147
class Person(pydantic.BaseModel):
149148
name: str
@@ -173,7 +172,7 @@ class Email(pydantic.BaseModel):
173172
"The email address should be at example.com"
174173
)
175174

176-
@pytest.mark.llm
175+
@pytest.mark.qualitative
177176
def test_generate_from_raw(session):
178177
prompts = ["what is 1+1?", "what is 2+2?", "what is 3+3?", "what is 4+4?"]
179178

@@ -183,7 +182,7 @@ def test_generate_from_raw(session):
183182

184183
assert len(results) == len(prompts)
185184

186-
@pytest.mark.llm
185+
@pytest.mark.qualitative
187186
def test_generate_from_raw_with_format(session):
188187
prompts = ["what is 1+1?", "what is 2+2?", "what is 3+3?", "what is 4+4?"]
189188

test/backends/test_ollama.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def session():
1818
session.reset()
1919

2020

21-
@pytest.mark.llm
21+
@pytest.mark.qualitative
2222
def test_simple_instruct(session):
2323
result = session.instruct(
2424
"Write an email to Hendrik trying to sell him self-sealing stembolts."
@@ -28,7 +28,7 @@ def test_simple_instruct(session):
2828
assert result._meta["chat_response"].message.role == "assistant"
2929

3030

31-
@pytest.mark.llm
31+
@pytest.mark.qualitative
3232
def test_instruct_with_requirement(session):
3333
response = session.instruct(
3434
"Write an email to Hendrik convincing him to buy some self-sealing stembolts."
@@ -51,14 +51,14 @@ def test_instruct_with_requirement(session):
5151
)
5252
print(results)
5353

54-
@pytest.mark.llm
54+
@pytest.mark.qualitative
5555
def test_chat(session):
5656
output_message = session.chat("What is 1+1?")
5757
assert "2" in output_message.content, (
5858
f"Expected a message with content containing 2 but found {output_message}"
5959
)
6060

61-
@pytest.mark.llm
61+
@pytest.mark.qualitative
6262
def test_format(session):
6363
class Person(pydantic.BaseModel):
6464
name: str
@@ -91,7 +91,7 @@ class Email(pydantic.BaseModel):
9191
# assert email.to.email_address.endswith("example.com")
9292
pass
9393

94-
@pytest.mark.llm
94+
@pytest.mark.qualitative
9595
def test_generate_from_raw(session):
9696
prompts = ["what is 1+1?", "what is 2+2?", "what is 3+3?", "what is 4+4?"]
9797

test/backends/test_openai_ollama.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def m_session(backend):
3737
yield session
3838
session.reset()
3939

40-
@pytest.mark.llm
40+
@pytest.mark.qualitative
4141
def test_instruct(m_session):
4242
result = m_session.instruct("Compute 1+1.")
4343
assert isinstance(result, ModelOutputThunk)
4444
assert "2" in result.value # type: ignore
4545

46-
@pytest.mark.llm
46+
@pytest.mark.qualitative
4747
def test_multiturn(m_session):
4848
m_session.instruct("What is the capital of France?")
4949
answer = m_session.instruct("Tell me the answer to the previous question.")
@@ -64,7 +64,7 @@ def test_multiturn(m_session):
6464
# assert "granite3.3:8b" in result.value
6565
# self.m.reset()
6666

67-
@pytest.mark.llm
67+
@pytest.mark.qualitative
6868
def test_format(m_session):
6969
class Person(pydantic.BaseModel):
7070
name: str

test/backends/test_watsonx.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ def session(backend):
2929
session.reset()
3030

3131

32-
@pytest.mark.llm
32+
@pytest.mark.qualitative
3333
def test_instruct(session):
3434
result = session.instruct("Compute 1+1.")
3535
assert isinstance(result, ModelOutputThunk)
3636
assert "2" in result.value # type: ignore
3737

3838

39-
@pytest.mark.llm
39+
@pytest.mark.qualitative
4040
def test_multiturn(session):
4141
session.instruct("What is the capital of France?")
4242
answer = session.instruct("Tell me the answer to the previous question.")
4343
assert "Paris" in answer.value # type: ignore
4444

4545

46-
@pytest.mark.llm
46+
@pytest.mark.qualitative
4747
def test_format(session):
4848
class Person(pydantic.BaseModel):
4949
name: str
@@ -77,7 +77,7 @@ class Email(pydantic.BaseModel):
7777
pass
7878

7979

80-
@pytest.mark.llm
80+
@pytest.mark.qualitative
8181
def test_generate_from_raw(session):
8282
prompts = ["what is 1+1?", "what is 2+2?", "what is 3+3?", "what is 4+4?"]
8383

test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def gh_run() -> int:
1414

1515

1616
def pytest_runtest_setup(item):
17-
# Runs tests *not* marked with `@pytest.mark.llm` to run normally.
17+
# Runs tests *not* marked with `@pytest.mark.qualitative` to run normally.
1818
if not item.get_closest_marker("qualitative"):
1919
return
2020

test/stdlib_basics/test_contextual_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_generative_with_contextual_session(model_id):
7474
assert isinstance(summary, str)
7575
assert len(summary) > 0
7676

77-
@pytest.mark.llm
77+
@pytest.mark.qualitative
7878
def test_generative_backward_compatibility(model_id):
7979
"""Test that generative slots still work with explicit session parameter."""
8080
with start_session(model_id=model_id) as m:

test/stdlib_basics/test_genslot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_func(session):
3333
write_email_component = write_me_an_email(session)
3434
assert isinstance(write_email_component, str)
3535

36-
@pytest.mark.llm
36+
@pytest.mark.qualitative
3737
def test_sentiment_output(classify_sentiment_output):
3838
assert classify_sentiment_output in ["positive", "negative"]
3939

0 commit comments

Comments
 (0)