Updated ruff to the latest version (#31926)
* Updated ruff version and fixed the required code accorindg to the latest version. * Updated ruff version and fixed the required code accorindg to the latest version. * Added noqa directive to ignore 1 error shown by ruff
This commit is contained in:
@@ -198,7 +198,7 @@ Action:
|
||||
)
|
||||
agent.run("What is 2 multiplied by 3.6452?")
|
||||
assert len(agent.logs) == 7
|
||||
assert type(agent.logs[-1]["error"]) == AgentMaxIterationsError
|
||||
assert type(agent.logs[-1]["error"]) is AgentMaxIterationsError
|
||||
|
||||
@require_torch
|
||||
def test_init_agent_with_different_toolsets(self):
|
||||
|
||||
@@ -214,7 +214,7 @@ recur_fibo(6)"""
|
||||
def test_access_attributes(self):
|
||||
code = "integer = 1\nobj_class = integer.__class__\nobj_class"
|
||||
result = evaluate_python_code(code, {}, state={})
|
||||
assert result == int
|
||||
assert result is int
|
||||
|
||||
def test_list_comprehension(self):
|
||||
code = "sentence = 'THESEAGULL43'\nmeaningful_sentence = '-'.join([char.lower() for char in sentence if char.isalpha()])"
|
||||
@@ -591,7 +591,7 @@ except ValueError as e:
|
||||
code = "type_a = float(2); type_b = str; type_c = int"
|
||||
state = {}
|
||||
result = evaluate_python_code(code, {"float": float, "str": str, "int": int}, state=state)
|
||||
assert result == int
|
||||
assert result is int
|
||||
|
||||
def test_tuple_id(self):
|
||||
code = """
|
||||
|
||||
@@ -56,7 +56,7 @@ class RoFormerTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
exp_tokens = [22943, 21332, 34431, 45904, 117, 306, 1231, 1231, 2653, 33994, 1266, 100]
|
||||
self.assertListEqual(tokenizer.convert_tokens_to_ids(input_tokens), exp_tokens)
|
||||
|
||||
def test_rust_tokenizer(self):
|
||||
def test_rust_tokenizer(self): # noqa: F811
|
||||
tokenizer = self.get_rust_tokenizer()
|
||||
input_text, output_text = self.get_chinese_input_output_texts()
|
||||
tokens = tokenizer.tokenize(input_text)
|
||||
|
||||
Reference in New Issue
Block a user