def test_merge_non_editable_url(from_line): """ Non-editable URLs are not supported. """ requirements = [ from_line("django==1.8"), from_line("https://example.com/#egg=example"), ] with pytest.raises(UnsupportedConstraint): merge(requirements, ignore_conflicts=True)
def test_merge(from_line): requirements = [ from_line("flask==1"), from_line("flask==1"), from_line("django==2"), ] assert Counter(requirements[1:3]) == Counter( merge(requirements, ignore_conflicts=False) )
def test_merge_urls(from_line): requirements = [ from_line("file:///example.zip#egg=example==1.0"), from_line("example==1.0"), from_line("file:///unrelated.zip"), ] assert Counter(requirements[1:]) == Counter( merge(requirements, ignore_conflicts=False) )
def test_merge(from_line): requirements = [from_line('flask==1'), from_line('flask==1'), from_line('django==2')] assert Counter(requirements[1:3]) == Counter(merge(requirements, ignore_conflicts=True))
def test_merge_detect_conflicts(from_line): requirements = [from_line('flask==1'), from_line('flask==2')] with pytest.raises(IncompatibleRequirements): merge(requirements, ignore_conflicts=False)
def test_merge_ignore_conflicts(from_line): requirements = [from_line("flask==1"), from_line("flask==2")] assert Counter(requirements[1:2]) == Counter( merge(requirements, ignore_conflicts=True) )
def test_merge_detect_conflicts(from_line): requirements = [from_line("flask==1"), from_line("flask==2")] with pytest.raises(IncompatibleRequirements): merge(requirements, ignore_conflicts=False)
def test_merge_ignore_conflicts(from_line): requirements = [from_line("flask==1"), from_line("flask==2")] assert Counter(requirements[1:2]) == Counter( merge(requirements, ignore_conflicts=True))