Re: [Tutor] Proper way to unit test the raising of exceptions?

2018-04-01 Thread Simon Connah via Tutor
a perfect fit for that particular problem. Thanks again. All of your help is much appreciated. On Sunday, 1 April 2018, 16:32:11 BST, Mats Wichmann wrote: On 04/01/2018 09:10 AM, Peter Otten wrote: > Simon Connah via Tutor wrote: > >> Hi, >> I'm just wondering w

[Tutor] Proper way to unit test the raising of exceptions?

2018-04-01 Thread Simon Connah via Tutor
Hi, I'm just wondering what the accepted way to handle unit testing exceptions is? I know you are meant to use assertRaises, but my code seems a little off. try:    some_func() except SomeException:    self.assertRaises(SomeException) Is there a better way to do this at all? The problem with the a

[Tutor] Does the secrets module in Python 3.6 use a hardware RNG like that provided in Intel CPUs?

2018-03-09 Thread Simon Connah via Tutor
Hi, I was reading through the secrets documentation in Python 3.6 and noticed that it uses /dev/urandom but I'm unsure if that means it'll use a hardware RNG or just one provided by the operating system (Linux / Windows / etc) in software. The question is is it possible to determine the source o