def test_simple_change(self): changed = {'a.py': [101, 102, 151]} dependencies = {'node1': {'test_a.py': [201, 202], 'a.py': [101, 102, 103]}, 'node2': {'test_b.py': [301, 302], 'a.py': [151]}} nodes, files = unaffected(dependencies, blockify(changed)) assert set(nodes) == {'node2'} assert set(files) == {'test_b.py'}
def test_nothing_changed(self): changed = {'a.py': [101, 102, 103]} dependencies = { 'node1': { 'test_a.py': [201, 202], 'a.py': [101, 102, 103] } } assert unaffected(dependencies, blockify(changed))[0] == dependencies
def affected_nodeids(dependencies, changes): unaffected_nodes, files = unaffected(dependencies, blockify(changes)) return set(dependencies) - set(unaffected_nodes)