Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
32
venv/Lib/site-packages/sklearn/tests/test_build.py
Normal file
32
venv/Lib/site-packages/sklearn/tests/test_build.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
import os
|
||||
import pytest
|
||||
import textwrap
|
||||
|
||||
from sklearn import __version__
|
||||
from sklearn.utils._openmp_helpers import _openmp_parallelism_enabled
|
||||
|
||||
|
||||
def test_openmp_parallelism_enabled():
|
||||
# Check that sklearn is built with OpenMP-based parallelism enabled.
|
||||
# This test can be skipped by setting the environment variable
|
||||
# ``SKLEARN_SKIP_OPENMP_TEST``.
|
||||
if os.getenv("SKLEARN_SKIP_OPENMP_TEST"):
|
||||
pytest.skip("test explicitly skipped (SKLEARN_SKIP_OPENMP_TEST)")
|
||||
|
||||
base_url = "dev" if __version__.endswith(".dev0") else "stable"
|
||||
err_msg = textwrap.dedent(
|
||||
"""
|
||||
This test fails because scikit-learn has been built without OpenMP.
|
||||
This is not recommended since some estimators will run in sequential
|
||||
mode instead of leveraging thread-based parallelism.
|
||||
|
||||
You can find instructions to build scikit-learn with OpenMP at this
|
||||
address:
|
||||
|
||||
https://scikit-learn.org/{}/developers/advanced_installation.html
|
||||
|
||||
You can skip this test by setting the environment variable
|
||||
SKLEARN_SKIP_OPENMP_TEST to any value.
|
||||
""").format(base_url)
|
||||
|
||||
assert _openmp_parallelism_enabled(), err_msg
|
Loading…
Add table
Add a link
Reference in a new issue