remove comparison with predefined booleans like np.bool

Signed-off-by: miguelgfierro <miguelgfierro@users.noreply.github.com>
This commit is contained in:
miguelgfierro 2024-07-17 12:20:21 +02:00
Родитель a4ce3cadcf
Коммит 0967dad53c
4 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -126,8 +126,8 @@ def test_download_and_extract_movielens(size, tmp):
)
# Test if raw-zip file, rating file, and item file are cached
assert len(os.listdir(tmp)) == 3
assert os.path.exists(rating_path) is True
assert os.path.exists(item_path) is True
assert os.path.exists(rating_path)
assert os.path.exists(item_path)
@pytest.mark.parametrize(

Просмотреть файл

@ -25,7 +25,7 @@ def test_maybe_download(files_fixtures):
os.remove(filepath)
downloaded_filepath = maybe_download(file_url, "license.txt", expected_bytes=1212)
assert os.path.exists(downloaded_filepath) is True
assert os.path.exists(downloaded_filepath)
assert os.path.basename(downloaded_filepath) == "license.txt"
@ -51,7 +51,7 @@ def test_maybe_download_maybe(caplog, files_fixtures):
os.remove(filepath)
downloaded_filepath = maybe_download(file_url, "license.txt")
assert os.path.exists(downloaded_filepath) is True
assert os.path.exists(downloaded_filepath)
maybe_download(file_url, "license.txt")
assert "File ." + os.path.sep + "license.txt already downloaded" in caplog.text
@ -69,11 +69,11 @@ def test_maybe_download_retry(caplog):
def test_download_path():
# Check that the temporal path is created and deleted
with download_path() as path:
assert os.path.isdir(path) is True
assert os.path.isdir(path) is False
assert os.path.isdir(path)
assert not os.path.isdir(path)
# Check the behavior when a path is provided
tmp_dir = TemporaryDirectory()
with download_path(tmp_dir.name) as path:
assert os.path.isdir(path) is True
assert os.path.isdir(path) is False
assert os.path.isdir(path)
assert not os.path.isdir(path)

Просмотреть файл

@ -117,8 +117,8 @@ def test_merge_rating(rating_true, rating_pred):
target_y_pred = np.array([14, 12, 7, 8, 13, 6, 11, 5])
assert y_true.shape == y_pred.shape
assert np.all(y_true == target_y_true) is True
assert np.all(y_pred == target_y_pred) is True
assert np.all(y_true == target_y_true)
assert np.all(y_pred == target_y_pred)
def test_merge_ranking(rating_true, rating_pred):

Просмотреть файл

@ -28,10 +28,10 @@ def model():
def test_vw_init_del():
model = VW()
tempdir = model.tempdir.name
assert os.path.exists(tempdir) is True
assert os.path.exists(tempdir)
del model
assert os.path.exists(tempdir) is False
assert not os.path.exists(tempdir)
@pytest.mark.experimental