Skip to content

Commit 97538d2

Browse files
committed
fix tests
1 parent 80fbefd commit 97538d2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

test/functional/toolchains/cmake/test_cmake_and_no_soname_flag.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def test_no_soname_flag(nosoname_property):
6464
# If `nosoname_property` is False, and we have a library without the SONAME flag,
6565
# then it should fail
6666
if nosoname_property is False:
67-
with pytest.raises(Exception, match=r"libnosoname.so: cannot open shared object "
68-
r"file: No such file or directory"):
69-
client.run_command(command)
67+
client.run_command(command, assert_error=True)
68+
assert "libnosoname.so: cannot open shared object file: " \
69+
"No such file or directory" in client.out
7070
else:
7171
client.run_command(command)
7272
assert "nosoname/0.1: Hello World Release!" in client.out

test/functional/tools/scm/test_git.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,8 @@ def test_clone_invalid_branch_argument(self):
596596
c = TestClient()
597597
git_args = ['--branch', 'foobar']
598598
c.save({"conanfile.py": self.conanfile.format(url=url, commit=commit, args=str(git_args))})
599-
with pytest.raises(Exception):
600-
c.run("create .")
601-
assert "Remote branch foobar not found" in c.out
599+
c.run("create .", assert_error=True)
600+
assert "Remote branch foobar not found" in c.out
602601

603602

604603
@pytest.mark.tool("git")

0 commit comments

Comments
 (0)