betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
567 stars 62 forks source link

Fixtures being called directly causes error on TravisCI #171

Closed pjbollinger closed 5 years ago

pjbollinger commented 5 years ago

While working on #170, TravisCI reported the following error for the test cases in tests.unit.test_fixtures.py::TestPyTestFixture:

Fixture "betamax_recorder" called directly. Fixtures are not meant to be called directly,
but are created automatically when test functions request them as parameters.
See https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and
https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code.

This was removed in pytest v4.0.0: https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly

It's not straight forward the best way to handle this since the class TestPyTestFixture inherits from unittest.TestCase. Reading the following link, https://docs.pytest.org/en/latest/unittest.html, I feel the test case would need to be modified to not inherit from unittest.TestCase. Much like tests.integration.test_fixtures.py::TestPyTestFixture.

jirikuncar commented 5 years ago

Fixed in #174