tests: use native pytest features for exception handling
tests: use native pytest features for exception handling

Using `with pytest.raises` is better than open coding the equivalent
feature. Similarly, when a block is not expected to raise an exception,
let's just let it run outside of a `try` block and rely on the test
framework to report a possible failure when hitting an unhandled
exception.

Change-Id: Icb1bb83e649733b56fcdc9168cabf88c9cf8d478

Telecominfraproject/gnpy