<commit_before># third party
import numpy as np
import pytest

# syft absolute
import syft as sy
from syft.core.adp.entity import Entity


def test_incompatible_input_tensor_type() -> None:
    x = sy.Tensor(np.float32([1, 2, 3, 4.0]))
    with pytest.raises(TypeError, match=r".* wrapping np.int32 .*"):
        out = x.private(min_val=0, max_val=5, entities="bob")


def test_string_entity() -> None:
    x = sy.Tensor([1, 2, 3, 4])
    out = x.private(min_val=0, max_val=5, entities="bob")
    assert out.child.entity.name == "bob"
<commit_msg>Fix unit test<commit_after># third party
import numpy as np
import pytest

# syft absolute
import syft as sy
from syft.core.adp.entity import Entity


def test_incompatible_input_tensor_type() -> None:

    try:
        x = sy.Tensor(np.float32([1, 2, 3, 4.0]))
        out = x.private(min_val=0, max_val=5, entities="bob")
        assert False
    except TypeError as e:
        assert True


def test_string_entity() -> None:
    x = sy.Tensor([1, 2, 3, 4])
    out = x.private(min_val=0, max_val=5, entities="bob")
    assert out.child.entity.name == "bob"

{'fraction_non_alphanumeric': 0.13821138211382114, 'fraction_numerical': 0.028906955736224028, 'mean_word_length': 3.4497991967871484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3522876', 'n_tokens_mistral': 427, 'n_tokens_neox': 402, 'n_words': 108}