Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix] Raise a helpful error when package reference is not present #589

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cpt/test/integration/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import unittest
import sys
import json
import textwrap

from conans import tools
from conans.model.ref import ConanFileReference
Expand Down Expand Up @@ -451,3 +452,17 @@ def configure(self):
self.packager = ConanMultiPackager(out=self.output.write)
self.packager.add_common_builds(pure_c=False, build_all_options_values=["qux:foo", "qux:bar", "qux:blah"])
self.packager.run()

def test_no_reference(self):
conanfile = textwrap.dedent("""
from conans import ConanFile
class Pkg(ConanFile):
def build(self):
pass
""")
self.save_conanfile(conanfile)
self.packager = ConanMultiPackager(out=self.output.write)
#with self.assertRaisesRegexp(Exception, "Specify a CONAN_REFERENCE or name and version fields in the recipe"):
self.packager.add(settings={"build_type": "Release"})
with self.assertRaises(TypeError):
self.packager.run()