Top "Raise" questions

How to use "raise" keyword in Python

I have read the official definition of "raise", but I still don't quite understand what it does. In simplest terms, …

python keyword raise
Best practice for Python assert

Is there a performance or code maintenance issue with using assert as part of the standard code instead of using …

python assert assertion raise
How to re-raise an exception in nested try/except blocks?

I know that if I want to re-raise an exception, I simple use raise without arguments in the respective except …

python exception nested raise
TypeError:exceptions must be old-style classes or derived from BaseException, not str

Following is my code: test = 'abc' if True: raise test + 'def' And when i run this, it gives me the …

python typeerror raise
Difference between Raise Try and Assert

I have been learning Python for a while and the raise function and assert are (what I realised is that …

python assert raise
How to use pytest to check that Error is NOT raised

Let's assume we have smth like that : import py, pytest ERROR1 = ' --- Error : value < 5! ---' ERROR2 = ' --- …

python pytest raise
Raise an event in C#

I came across this question in a Microsoft Practice Test and I got confused. Here is the question: Which of …

c# events raise
Rails ActiveSupport: How to assert that an error is raised?

I am wanting to test a function on one of my models that throws specific errors. The function looks something …

ruby-on-rails assert activesupport raise
Proper way of raising events from C++/CLI?

I was wondering what's the proper way of raising events from C++/CLI. In C# one should first make a …

events c++-cli raise
Convert c# to vb.net 'RaiseEvent' statement to raise an event to use Gzip

I have convert class from c# to vb.net .. My point that I want to compress asp.net page to …

events gzip raise raiseevent