============================= test session starts ============================== platform linux -- Python 3.5.3, pytest-3.0.6, py-1.4.32, pluggy-0.4.0 rootdir: /<>, inifile: plugins: postgresql-1.3.4, hypothesis-3.6.1, celery-4.2.1 collected 42 items swh/scheduler/tests/test_celery_tasks.py .. swh/scheduler/tests/test_utils.py ... swh/scheduler/tests/updater/test_backend.py F swh/scheduler/tests/updater/test_consumer.py ... swh/scheduler/tests/updater/test_events.py ... swh/scheduler/tests/updater/test_ghtorrent.py ...... =================================== FAILURES =================================== _______________________________ test_cache_read ________________________________ swh_scheduler_updater = @given(urls=sets( > from_regex( r'^https://somewhere[.]org/[a-z0-9]{5,7}/[a-z0-9]{3,10}$'), min_size=10, max_size=15)) def test_cache_read(urls, swh_scheduler_updater): swh/scheduler/tests/updater/test_backend.py:15: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/hypothesis/core.py:524: in wrapped_test print_example=True, is_final=True /usr/lib/python3/dist-packages/hypothesis/executors.py:58: in default_new_style_executor return function(data) /usr/lib/python3/dist-packages/hypothesis/core.py:111: in run return test(*args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urls = {'', '0', '0\r0', '1', '2', '3', ...} swh_scheduler_updater = @given(urls=sets( from_regex( r'^https://somewhere[.]org/[a-z0-9]{5,7}/[a-z0-9]{3,10}$'), min_size=10, max_size=15)) def test_cache_read(urls, swh_scheduler_updater): # beware that the fixture is only called once for all the tests # generated by hypothesis, so the db is not cleared between calls. # see the end of # https://hypothesis.works/articles/hypothesis-pytest-fixtures/ def gen_events(urls): for url in urls: yield SWHEvent({ 'url': url, 'type': 'create', 'origin_type': 'git', }) known_urls = set(e['url'] for e in swh_scheduler_updater.cache_read(limit=1000000)) swh_scheduler_updater.cache_put(gen_events(urls)) new_urls = {u.strip() for u in urls} - known_urls all_urls = set(e['url'] for e in swh_scheduler_updater.cache_read(limit=1000000)) > assert (all_urls - known_urls) == new_urls E assert set() == {'0\r0'} E Extra items in the right set: E '0\r0' E Use -v to get the full diff swh/scheduler/tests/updater/test_backend.py:36: AssertionError ---------------------------------- Hypothesis ---------------------------------- Falsifying example: test_cache_read(urls={'', '0', '0\r0', '1', '2', '3', '4', '5', '6', '7'}, swh_scheduler_updater=)