Here are the examples of the python api scrapi.requests.time taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
Project: scrapi Source File: test_harvesters.py
@pytest.mark.parametrize('harvester_name', filter(lambda x: x != 'test', sorted(map(str, registry.keys()))))
def test_harvester(monkeypatch, harvester_name, *args, **kwargs):
monkeypatch.setattr(requests.time, 'sleep', lambda *_, **__: None)
base.settings.RAISE_IN_TRANSFORMER = True
harvester = registry[harvester_name]
with vcr.use_cassette('tests/vcr/{}.yaml'.format(harvester_name), match_on=['host'], record_mode='none'):
harvested = harvester.harvest()
assert len(harvested) > 0
normalized = list(filter(lambda x: x is not None, map(harvester.normalize, harvested[:25])))
assert len(normalized) > 0