diff --git a/examples/deviceinfo.mojo b/examples/deviceinfo.mojo index 62428a9b536..f2c79fa3e10 100644 --- a/examples/deviceinfo.mojo +++ b/examples/deviceinfo.mojo @@ -14,8 +14,26 @@ # This sample prints the current host system information using APIs from the # sys module. -from sys.info import * -from sys.info import _current_cpu, _current_target, _triple_attr +from sys.info import ( + _current_cpu, + _current_target, + _triple_attr, + os_is_linux, + os_is_macos, + os_is_windows, + has_sse4, + has_avx, + has_avx2, + has_avx512f, + has_vnni, + has_intel_amx, + has_neon, + is_apple_m1, + is_apple_m2, + is_apple_m3, + num_physical_cores, + num_logical_cores, +) def main(): diff --git a/stdlib/test/builtin/test_bfloat16.mojo b/stdlib/test/builtin/test_bfloat16.mojo index bc3b5f10b51..3b341e4ba7f 100644 --- a/stdlib/test/builtin/test_bfloat16.mojo +++ b/stdlib/test/builtin/test_bfloat16.mojo @@ -15,7 +15,7 @@ from random import randn_float64 from sys.info import has_neon -from testing import * +from testing import assert_equal, assert_almost_equal def test_methods(): diff --git a/stdlib/test/builtin/test_dtype.mojo b/stdlib/test/builtin/test_dtype.mojo index b0fc366792a..5e996d66779 100644 --- a/stdlib/test/builtin/test_dtype.mojo +++ b/stdlib/test/builtin/test_dtype.mojo @@ -14,7 +14,7 @@ from collections import Set -from testing import * +from testing import assert_equal, assert_false, assert_true fn test_stringable() raises: diff --git a/stdlib/test/builtin/test_hash.mojo b/stdlib/test/builtin/test_hash.mojo index 934b2c15b87..1bd5aac2d9f 100644 --- a/stdlib/test/builtin/test_hash.mojo +++ b/stdlib/test/builtin/test_hash.mojo @@ -19,7 +19,7 @@ # specific. But for now they test behavior and reproducibility. from builtin.hash import _hash_simd -from testing import * +from testing import assert_equal, assert_not_equal, assert_true def same_low_bits(i1: Int, i2: Int, bits: Int = 4) -> Int: diff --git a/stdlib/test/builtin/test_int.mojo b/stdlib/test/builtin/test_int.mojo index 82b5046c20b..c983817c197 100644 --- a/stdlib/test/builtin/test_int.mojo +++ b/stdlib/test/builtin/test_int.mojo @@ -12,7 +12,7 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s -from testing import * +from testing import assert_equal def test_constructors(): diff --git a/stdlib/test/builtin/test_issue_1505.mojo b/stdlib/test/builtin/test_issue_1505.mojo index aea24055730..8c1ef6eb206 100644 --- a/stdlib/test/builtin/test_issue_1505.mojo +++ b/stdlib/test/builtin/test_issue_1505.mojo @@ -16,7 +16,7 @@ from random import random_ui64 -from testing import * +from testing import assert_equal fn gen_perm() -> StaticIntTuple[64]: diff --git a/stdlib/test/builtin/test_location.mojo b/stdlib/test/builtin/test_location.mojo index ec5b730ecd1..500230e4609 100644 --- a/stdlib/test/builtin/test_location.mojo +++ b/stdlib/test/builtin/test_location.mojo @@ -13,7 +13,7 @@ # RUN: mojo --debug-level full %s from builtin._location import _SourceLocation -from testing import * +from testing import assert_equal def main(): diff --git a/stdlib/test/builtin/test_simd.mojo b/stdlib/test/builtin/test_simd.mojo index 60c767a9c95..c94d06b7a67 100644 --- a/stdlib/test/builtin/test_simd.mojo +++ b/stdlib/test/builtin/test_simd.mojo @@ -14,7 +14,7 @@ from sys.info import has_neon, simdwidthof -from testing import * +from testing import assert_equal, assert_not_equal, assert_true # CHECK-LABEL: test_cast diff --git a/stdlib/test/builtin/test_slice.mojo b/stdlib/test/builtin/test_slice.mojo index 1370bf88d58..0a405c0be5b 100644 --- a/stdlib/test/builtin/test_slice.mojo +++ b/stdlib/test/builtin/test_slice.mojo @@ -12,7 +12,7 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s | FileCheck %s -from testing import * +from testing import assert_equal, assert_false # CHECK-LABEL: test_none_end_folds diff --git a/stdlib/test/builtin/test_str.mojo b/stdlib/test/builtin/test_str.mojo index 3e8dbd3c857..5694d97d224 100644 --- a/stdlib/test/builtin/test_str.mojo +++ b/stdlib/test/builtin/test_str.mojo @@ -12,7 +12,7 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s -from testing import * +from testing import assert_equal def test_str_none(): diff --git a/stdlib/test/builtin/test_string.mojo b/stdlib/test/builtin/test_string.mojo index ab2588de10c..6c4fa21f168 100644 --- a/stdlib/test/builtin/test_string.mojo +++ b/stdlib/test/builtin/test_string.mojo @@ -16,7 +16,13 @@ from builtin.string import ( _calc_initial_buffer_size_int32, _calc_initial_buffer_size_int64, ) -from testing import * +from testing import ( + assert_equal, + assert_false, + assert_not_equal, + assert_raises, + assert_true, +) from utils import StringRef diff --git a/stdlib/test/builtin/test_string_literal.mojo b/stdlib/test/builtin/test_string_literal.mojo index 0299683f949..4473dadcc6b 100644 --- a/stdlib/test/builtin/test_string_literal.mojo +++ b/stdlib/test/builtin/test_string_literal.mojo @@ -12,7 +12,13 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s -from testing import * +from testing import ( + assert_equal, + assert_not_equal, + assert_true, + assert_false, + assert_raises, +) def test_basics(): diff --git a/stdlib/test/builtin/test_stringref.mojo b/stdlib/test/builtin/test_stringref.mojo index fa4c62e890f..bddfb751f41 100644 --- a/stdlib/test/builtin/test_stringref.mojo +++ b/stdlib/test/builtin/test_stringref.mojo @@ -12,7 +12,7 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s -from testing import * +from testing import assert_equal, assert_raises from utils import StringRef diff --git a/stdlib/test/collections/test_dict.mojo b/stdlib/test/collections/test_dict.mojo index d0fab97329d..7ed576a0ded 100644 --- a/stdlib/test/collections/test_dict.mojo +++ b/stdlib/test/collections/test_dict.mojo @@ -16,7 +16,7 @@ from collections import Optional from collections.dict import Dict, KeyElement from test_utils import CopyCounter -from testing import * +from testing import assert_equal, assert_false, assert_raises def test_dict_construction(): diff --git a/stdlib/test/collections/test_list.mojo b/stdlib/test/collections/test_list.mojo index 6e3de70d171..344e03a72d1 100644 --- a/stdlib/test/collections/test_list.mojo +++ b/stdlib/test/collections/test_list.mojo @@ -15,7 +15,7 @@ from collections import List from test_utils import CopyCounter, MoveCounter -from testing import * +from testing import assert_equal def test_mojo_issue_698(): diff --git a/stdlib/test/collections/test_optional.mojo b/stdlib/test/collections/test_optional.mojo index e45ff5551de..22a6858c34a 100644 --- a/stdlib/test/collections/test_optional.mojo +++ b/stdlib/test/collections/test_optional.mojo @@ -14,7 +14,7 @@ from collections.optional import Optional, OptionalReg -from testing import * +from testing import assert_true, assert_false, assert_equal def test_basic(): diff --git a/stdlib/test/collections/test_set.mojo b/stdlib/test/collections/test_set.mojo index 74ef6409f7e..4e94a06d7ed 100644 --- a/stdlib/test/collections/test_set.mojo +++ b/stdlib/test/collections/test_set.mojo @@ -14,7 +14,7 @@ from collections.set import Set -from testing import * +from testing import assert_raises, assert_true, assert_false fn assert_equal[T: EqualityComparable](lhs: T, rhs: T) raises: diff --git a/stdlib/test/collections/test_vector.mojo b/stdlib/test/collections/test_vector.mojo index 406a782d84c..b242b792f85 100644 --- a/stdlib/test/collections/test_vector.mojo +++ b/stdlib/test/collections/test_vector.mojo @@ -15,7 +15,7 @@ from collections.vector import InlinedFixedVector from test_utils import MoveCounter -from testing import * +from testing import assert_equal def test_inlined_fixed_vector(): diff --git a/stdlib/test/memory/test_anypointer.mojo b/stdlib/test/memory/test_anypointer.mojo index ce9377089ff..52c0d0583f9 100644 --- a/stdlib/test/memory/test_anypointer.mojo +++ b/stdlib/test/memory/test_anypointer.mojo @@ -14,7 +14,7 @@ from memory.anypointer import AnyPointer from test_utils import MoveCounter -from testing import * +from testing import assert_equal, assert_not_equal, assert_true struct MoveOnlyType(Movable): diff --git a/stdlib/test/memory/test_arc.mojo b/stdlib/test/memory/test_arc.mojo index c2748d1cfd6..2e303491363 100644 --- a/stdlib/test/memory/test_arc.mojo +++ b/stdlib/test/memory/test_arc.mojo @@ -15,7 +15,7 @@ from collections import List from memory._arc import Arc -from testing import * +from testing import assert_equal, assert_false, assert_true def test_basic(): diff --git a/stdlib/test/os/path/test_exists.mojo b/stdlib/test/os/path/test_exists.mojo index 347e1f1c794..966f022f91a 100644 --- a/stdlib/test/os/path/test_exists.mojo +++ b/stdlib/test/os/path/test_exists.mojo @@ -16,7 +16,7 @@ from os.path import exists, lexists from pathlib import Path, cwd -from testing import * +from testing import assert_true, assert_false def main(): diff --git a/stdlib/test/os/path/test_isdir.mojo b/stdlib/test/os/path/test_isdir.mojo index c539d2f310b..b5a936f0fd0 100644 --- a/stdlib/test/os/path/test_isdir.mojo +++ b/stdlib/test/os/path/test_isdir.mojo @@ -15,7 +15,7 @@ from os.path import isdir from pathlib import Path, cwd -from testing import * +from testing import assert_true, assert_false def main(): diff --git a/stdlib/test/os/path/test_isfile.mojo b/stdlib/test/os/path/test_isfile.mojo index 4e5b07152fa..012a251b6dc 100644 --- a/stdlib/test/os/path/test_isfile.mojo +++ b/stdlib/test/os/path/test_isfile.mojo @@ -15,7 +15,7 @@ from os.path import isfile from pathlib import Path -from testing import * +from testing import assert_true, assert_false def main(): diff --git a/stdlib/test/os/path/test_islink.mojo b/stdlib/test/os/path/test_islink.mojo index a63d15a72de..f8d55d5909f 100644 --- a/stdlib/test/os/path/test_islink.mojo +++ b/stdlib/test/os/path/test_islink.mojo @@ -20,7 +20,7 @@ from os.path import isdir, islink from pathlib import Path from sys.param_env import env_get_string -from testing import * +from testing import assert_true, assert_false alias TEMP_DIR = env_get_string["TEMP_DIR"]() diff --git a/stdlib/test/os/test_listdir.mojo b/stdlib/test/os/test_listdir.mojo index 6737bd85043..945bdf6b3a2 100644 --- a/stdlib/test/os/test_listdir.mojo +++ b/stdlib/test/os/test_listdir.mojo @@ -12,10 +12,10 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s -from os import * +from os import listdir from pathlib import Path -from testing import * +from testing import assert_true def test_listdir(): diff --git a/stdlib/test/os/test_stat.mojo b/stdlib/test/os/test_stat.mojo index 6e454529057..1e1a3d5ffb3 100644 --- a/stdlib/test/os/test_stat.mojo +++ b/stdlib/test/os/test_stat.mojo @@ -12,10 +12,10 @@ # ===----------------------------------------------------------------------=== # # RUN: %mojo -debug-level full %s -from os import * +from os import stat from stat import S_ISREG -from testing import * +from testing import assert_not_equal, assert_true def main(): diff --git a/stdlib/test/pathlib/test_pathlib.mojo b/stdlib/test/pathlib/test_pathlib.mojo index 9f67761117d..b19d5599f0f 100644 --- a/stdlib/test/pathlib/test_pathlib.mojo +++ b/stdlib/test/pathlib/test_pathlib.mojo @@ -13,10 +13,10 @@ # REQUIRES: !windows # RUN: %mojo -debug-level full -D TEMP_FILE=%t %s -from pathlib import * +from pathlib import cwd, Path, DIR_SEPARATOR from sys.param_env import env_get_string -from testing import * +from testing import assert_true, assert_false, assert_equal, assert_not_equal alias TEMP_FILE = env_get_string["TEMP_FILE"]() diff --git a/stdlib/test/test_utils/__init__.mojo b/stdlib/test/test_utils/__init__.mojo index 291c1de5284..976e8db5144 100644 --- a/stdlib/test/test_utils/__init__.mojo +++ b/stdlib/test/test_utils/__init__.mojo @@ -4,5 +4,5 @@ # # ===----------------------------------------------------------------------=== # -from .test_utils import * +from .test_utils import libm_call from .types import CopyCounter, MoveCounter, MoveOnly diff --git a/stdlib/test/utils/test_variant.mojo b/stdlib/test/utils/test_variant.mojo index 709dee59e68..c9c4ec30482 100644 --- a/stdlib/test/utils/test_variant.mojo +++ b/stdlib/test/utils/test_variant.mojo @@ -15,7 +15,7 @@ from sys.ffi import _get_global from memory.unsafe import Pointer -from testing import * +from testing import assert_equal, assert_false, assert_true from utils.variant import Variant