code: def test_invalid_max_iter(setup):
      invalid_max_iter = -1
      error_msg = re.escape(
          "Maximum number of iteration must be positive;"
          " got (max_iter=%r)" % invalid_max_iter
      )
  
      with pytest.raises(ValueError, match=error_msg):
          model = LogisticRegression(max_iter=invalid_max_iter)
          model.fit(X, y)
  
file_path: mars/mars/learn/glm/tests/test_logistic.py
imports: import re
  import pytest
  from sklearn.datasets import load_iris
  from .._logistic import _check_solver, _check_multi_class, LogisticRegression
label_desc: Use image node_id 5 for calling a global function with example usage: test_invalid_max_iter(setup) without return types