import pytest
from hypothesis import given
from hypothesis.strategies import lists, text
from datatyping.datatyping import validate


@given(ss=lists(text()))
def test_simple(ss):
    assert validate([str], ss) is None


@given(s=text())
def test_simple_error(s):
    with pytest.raises(TypeError):
        validate([str], s)


@given(ss=lists(lists(text())))
def test_nested(ss):
    assert validate([[str]], ss) is None

import pytest
from hypothesis import given
from hypothesis.strategies import integers, text

from datatyping.datatyping import validate


@given(string=text())
def test_simple(string):
    assert validate(str, string) is None


@given(not_string=integers())
def test_simple_error(not_string):
    with pytest.raises(TypeError):
        validate(str, not_string)

Rewrite str tests with hypothesis Remove lists from testing
Rewrite str tests with hypothesis
Remove lists from testing

  import pytest
  from hypothesis import given
- from hypothesis.strategies import lists, text
+ from hypothesis.strategies import integers, text
+ 
  from datatyping.datatyping import validate
  
  
- @given(ss=lists(text()))
+ @given(string=text())
- def test_simple(ss):
+ def test_simple(string):
-     assert validate([str], ss) is None
+     assert validate(str, string) is None
  
  
- @given(s=text())
+ @given(not_string=integers())
- def test_simple_error(s):
+ def test_simple_error(not_string):
      with pytest.raises(TypeError):
-         validate([str], s)
+         validate(str, not_string)
  
- 
- @given(ss=lists(lists(text())))
- def test_nested(ss):
-     assert validate([[str]], ss) is None
- 
Rewrite str tests with hypothesis Remove lists from testing
## Code Before:
import pytest
from hypothesis import given
from hypothesis.strategies import lists, text
from datatyping.datatyping import validate


@given(ss=lists(text()))
def test_simple(ss):
    assert validate([str], ss) is None


@given(s=text())
def test_simple_error(s):
    with pytest.raises(TypeError):
        validate([str], s)


@given(ss=lists(lists(text())))
def test_nested(ss):
    assert validate([[str]], ss) is None

## Instruction:
Rewrite str tests with hypothesis Remove lists from testing
## Code After:
import pytest
from hypothesis import given
from hypothesis.strategies import integers, text

from datatyping.datatyping import validate


@given(string=text())
def test_simple(string):
    assert validate(str, string) is None


@given(not_string=integers())
def test_simple_error(not_string):
    with pytest.raises(TypeError):
        validate(str, not_string)
