
import pytest

import fuzzinator


@pytest.mark.parametrize('fuzzer_kwargs, exp_min_len, exp_max_len', [
    ({}, 1, 1),
    ({'max_length': '100'}, 1, 100),
    ({'min_length': '10', 'max_length': '100'}, 10, 100),
])
def test_random_content(fuzzer_kwargs, exp_min_len, exp_max_len):
    for index in range(100):
        out = fuzzinator.fuzzer.RandomContent(index=index, **fuzzer_kwargs)
        out_len = len(out)
        assert out_len >= exp_min_len and out_len <= exp_max_len


import pytest

import fuzzinator


@pytest.mark.parametrize('fuzzer_kwargs, exp_min_len, exp_max_len', [
    ({}, 1, 1),
    ({'max_length': '100'}, 1, 100),
    ({'min_length': '10', 'max_length': '100'}, 10, 100),
])
def test_random_content(fuzzer_kwargs, exp_min_len, exp_max_len):
    for index in range(100):
        out = fuzzinator.fuzzer.RandomContent(index=index, **fuzzer_kwargs)
        out_len = len(out)
        assert exp_min_len <= out_len <= exp_max_len

Make use of chained comparisons
Make use of chained comparisons

  
  import pytest
  
  import fuzzinator
  
  
  @pytest.mark.parametrize('fuzzer_kwargs, exp_min_len, exp_max_len', [
      ({}, 1, 1),
      ({'max_length': '100'}, 1, 100),
      ({'min_length': '10', 'max_length': '100'}, 10, 100),
  ])
  def test_random_content(fuzzer_kwargs, exp_min_len, exp_max_len):
      for index in range(100):
          out = fuzzinator.fuzzer.RandomContent(index=index, **fuzzer_kwargs)
          out_len = len(out)
-         assert out_len >= exp_min_len and out_len <= exp_max_len
+         assert exp_min_len <= out_len <= exp_max_len
  
Make use of chained comparisons
## Code Before:

import pytest

import fuzzinator


@pytest.mark.parametrize('fuzzer_kwargs, exp_min_len, exp_max_len', [
    ({}, 1, 1),
    ({'max_length': '100'}, 1, 100),
    ({'min_length': '10', 'max_length': '100'}, 10, 100),
])
def test_random_content(fuzzer_kwargs, exp_min_len, exp_max_len):
    for index in range(100):
        out = fuzzinator.fuzzer.RandomContent(index=index, **fuzzer_kwargs)
        out_len = len(out)
        assert out_len >= exp_min_len and out_len <= exp_max_len

## Instruction:
Make use of chained comparisons
## Code After:

import pytest

import fuzzinator


@pytest.mark.parametrize('fuzzer_kwargs, exp_min_len, exp_max_len', [
    ({}, 1, 1),
    ({'max_length': '100'}, 1, 100),
    ({'min_length': '10', 'max_length': '100'}, 10, 100),
])
def test_random_content(fuzzer_kwargs, exp_min_len, exp_max_len):
    for index in range(100):
        out = fuzzinator.fuzzer.RandomContent(index=index, **fuzzer_kwargs)
        out_len = len(out)
        assert exp_min_len <= out_len <= exp_max_len
