- Notifications
You must be signed in to change notification settings - Fork 105
Closed
Labels
Description
We have a base TestCase with simple test and one inheritor(see below). When inheritor and TestCase are launched by one worker, the mock_open is getting torn down after it's first use, and not correctly built again(returns empty string) on subsequent calls.
import mock import six import testtools class TestCase(testtools.TestCase): @mock.patch.object(six.moves.builtins, 'open', mock.mock_open(read_data='FAKE_DATA')) def test_check_open(self): with open("some") as f: self.assertEqual('FAKE_DATA', f.read()) class AnotherTestCase(TestCase): pass