Merge "Revert "Get required fixture even from owner object type""

changes/56/809156/1 0.4.9
Zuul 1 year ago committed by Gerrit Code Review
commit af377b71ac
  1. 5
      tobiko/common/_fixture.py
  2. 6
      tobiko/tests/unit/test_fixture.py

@ -484,7 +484,10 @@ class RequiredFixtureProperty(object):
self.setup = setup
def __get__(self, instance, _):
return self.get_fixture(instance)
if instance is None:
return self
else:
return self.get_fixture(instance)
def get_fixture(self, _instance):
fixture = get_fixture(self.fixture, **self.fixture_params)

@ -388,12 +388,6 @@ class RequiredFixtureTest(unit.TobikoUnitTest):
fixture.setup_fixture.assert_not_called()
fixture.cleanup_fixture.assert_not_called()
def test_required_fixture_with_type(self):
fixture = type(self).required_fixture
self.assertIsInstance(fixture, MyRequiredFixture)
fixture.setup_fixture.assert_called()
fixture.cleanup_fixture.assert_not_called()
class SharedFixtureTest(unit.TobikoUnitTest):

Loading…
Cancel
Save