kiwicom / pytest-recording

A pytest plugin that allows recording network interactions via VCR.py
MIT License
425 stars 34 forks source link

How to setup common VCR config for all tests #39

Closed northtree closed 4 years ago

northtree commented 4 years ago

The following config seems not working under tests/__init__.py, but works within tests/test_foo.py, tests/test_bar.py...

import pytest

@pytest.fixture(scope='module', autouse=True)
def vcr_config():
  return {'ignore_hosts': ['oauth2.googleapis.com']}
Stranger6667 commented 4 years ago

It should be in conftest.py, pytest collects fixtures from conftest.py files (in most common cases)

Stranger6667 commented 4 years ago

Hopefully, the problem is resolved now. We can add some clarification to our Configuration section as a part of #49.

Feel free to reopen this issue in case of any further questions