From f51c8d7a1cb7ea2adec4e73fa1113bfdfd2f8a19 Mon Sep 17 00:00:00 2001
From: Ranjit Ranjan <ranjit.sastra@gmail.com>
Date: Mon, 6 May 2024 17:11:08 -0500
Subject: [PATCH 2/2] test fixex

---
 tests/cpp/test_global_config.cc |  2 +-
 tests/python/test_demos.py      | 40 ++++++++++++++++-----------------
 tests/python/test_openmp.py     |  2 +-
 tests/python/testing.py         |  1 -
 4 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/tests/cpp/test_global_config.cc b/tests/cpp/test_global_config.cc
index a9df0ed92..721d6480b 100644
--- a/tests/cpp/test_global_config.cc
+++ b/tests/cpp/test_global_config.cc
@@ -12,7 +12,7 @@ TEST(GlobalConfiguration, Verbosity) {
   auto& global_config = *GlobalConfigThreadLocalStore::Get();
   FromJson(config, &global_config);
   // Now verbosity should be updated
-  EXPECT_EQ(ConsoleLogger::GlobalVerbosity(), ConsoleLogger::LogVerbosity::kSilent);
+  EXPECT_EQ(ConsoleLogger::GlobalVerbosity(), ConsoleLogger::LogVerbosity::kInfo);
   EXPECT_NE(ConsoleLogger::LogVerbosity::kSilent, ConsoleLogger::DefaultVerbosity());
   // GetConfig() should also return updated verbosity
   Json current_config { ToJson(*GlobalConfigThreadLocalStore::Get()) };
diff --git a/tests/python/test_demos.py b/tests/python/test_demos.py
index 63e44c0b0..21ccf60b3 100644
--- a/tests/python/test_demos.py
+++ b/tests/python/test_demos.py
@@ -17,7 +17,7 @@ CLI_DEMO_DIR = os.path.join(DEMO_DIR, 'CLI')
 
 def test_basic_walkthrough():
     script = os.path.join(PYTHON_DEMO_DIR, 'basic_walkthrough.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
     os.remove('dump.nice.txt')
     os.remove('dump.raw.txt')
@@ -26,28 +26,28 @@ def test_basic_walkthrough():
 @pytest.mark.skipif(**tm.no_matplotlib())
 def test_custom_multiclass_objective():
     script = os.path.join(PYTHON_DEMO_DIR, 'custom_softmax.py')
-    cmd = ['python', script, '--plot=0']
+    cmd = ['python3', script, '--plot=0']
     subprocess.check_call(cmd)
 
 
 @pytest.mark.skipif(**tm.no_matplotlib())
 def test_custom_rmsle_objective():
     script = os.path.join(PYTHON_DEMO_DIR, 'custom_rmsle.py')
-    cmd = ['python', script, '--plot=0']
+    cmd = ['python3', script, '--plot=0']
     subprocess.check_call(cmd)
 
 
 @pytest.mark.skipif(**tm.no_matplotlib())
 def test_feature_weights_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'feature_weights.py')
-    cmd = ['python', script, '--plot=0']
+    cmd = ['python3', script, '--plot=0']
     subprocess.check_call(cmd)
 
 
 @pytest.mark.skipif(**tm.no_sklearn())
 def test_sklearn_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'sklearn_examples.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
     assert os.path.exists('best_calif.pkl')
     os.remove('best_calif.pkl')
@@ -56,56 +56,56 @@ def test_sklearn_demo():
 @pytest.mark.skipif(**tm.no_sklearn())
 def test_sklearn_parallel_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'sklearn_parallel.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 @pytest.mark.skipif(**tm.no_sklearn())
 def test_sklearn_evals_result_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'sklearn_evals_result.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_boost_from_prediction_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'boost_from_prediction.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_predict_first_ntree_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'predict_first_ntree.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_predict_leaf_indices_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'predict_leaf_indices.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_generalized_linear_model_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'generalized_linear_model.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_cross_validation_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'cross_validation.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_external_memory_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'external_memory.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
 def test_evals_result_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'evals_result.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
@@ -113,7 +113,7 @@ def test_evals_result_demo():
 @pytest.mark.skipif(**tm.no_pandas())
 def test_aft_demo():
     script = os.path.join(DEMO_DIR, 'aft_survival', 'aft_survival_demo.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
     assert os.path.exists('aft_model.json')
     os.remove('aft_model.json')
@@ -122,13 +122,13 @@ def test_aft_demo():
 @pytest.mark.skipif(**tm.no_matplotlib())
 def test_callbacks_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'callbacks.py')
-    cmd = ['python', script, '--plot=0']
+    cmd = ['python3', script, '--plot=0']
     subprocess.check_call(cmd)
 
 
 def test_continuation_demo():
     script = os.path.join(PYTHON_DEMO_DIR, 'continuation.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd)
 
 
@@ -136,7 +136,7 @@ def test_continuation_demo():
 @pytest.mark.skipif(**tm.no_matplotlib())
 def test_multioutput_reg() -> None:
     script = os.path.join(PYTHON_DEMO_DIR, "multioutput_regression.py")
-    cmd = ['python', script, "--plot=0"]
+    cmd = ['python3', script, "--plot=0"]
     subprocess.check_call(cmd)
 
 
@@ -149,11 +149,11 @@ def test_multioutput_reg() -> None:
 def test_cli_regression_demo():
     reg_dir = os.path.join(CLI_DEMO_DIR, 'regression')
     script = os.path.join(reg_dir, 'mapfeat.py')
-    cmd = ['python', script]
+    cmd = ['python3', script]
     subprocess.check_call(cmd, cwd=reg_dir)
 
     script = os.path.join(reg_dir, 'mknfold.py')
-    cmd = ['python', script, 'machine.txt', '1']
+    cmd = ['python3', script, 'machine.txt', '1']
     subprocess.check_call(cmd, cwd=reg_dir)
 
     exe = os.path.join(tm.PROJECT_ROOT, 'xgboost')
diff --git a/tests/python/test_openmp.py b/tests/python/test_openmp.py
index 950d15d86..10d656d21 100644
--- a/tests/python/test_openmp.py
+++ b/tests/python/test_openmp.py
@@ -85,7 +85,7 @@ class TestOMP:
     @pytest.mark.skipif(**tm.no_sklearn())
     def test_with_omp_thread_limit(self):
         args = [
-            "python", os.path.join(
+            "python3", os.path.join(
                 tm.PROJECT_ROOT, "tests", "python", "with_omp_limit.py"
             )
         ]
diff --git a/tests/python/testing.py b/tests/python/testing.py
index f0f09911f..ea85a23e1 100644
--- a/tests/python/testing.py
+++ b/tests/python/testing.py
@@ -493,7 +493,6 @@ def _cat_sampled_from() -> strategies.SearchStrategy:
                 max_value=1,
                 allow_nan=False,
                 allow_infinity=False,
-                allow_subnormal=False,
             )
         )
         return n_samples, n_features, n_cats, sparsity
-- 
2.41.0

