@@ -361,7 +361,7 @@ def test_connection(self):
361361class ServerUsageErrorsTests (unittest .TestCase ):
362362 def test_unix_without_path_or_sock (self ):
363363 """Unix server requires path when sock isn't provided."""
364- with self .assertRaises (TypeError ) as raised :
364+ with self .assertRaises (ValueError ) as raised :
365365 unix_serve (handler )
366366 self .assertEqual (
367367 str (raised .exception ),
@@ -372,7 +372,7 @@ def test_unix_with_path_and_sock(self):
372372 """Unix server rejects path when sock is provided."""
373373 sock = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
374374 self .addCleanup (sock .close )
375- with self .assertRaises (TypeError ) as raised :
375+ with self .assertRaises (ValueError ) as raised :
376376 unix_serve (handler , path = "/" , sock = sock )
377377 self .assertEqual (
378378 str (raised .exception ),
@@ -504,7 +504,7 @@ def check_credentials(username, password):
504504
505505 def test_without_credentials_or_check_credentials (self ):
506506 """basic_auth requires either credentials or check_credentials."""
507- with self .assertRaises (TypeError ) as raised :
507+ with self .assertRaises (ValueError ) as raised :
508508 basic_auth ()
509509 self .assertEqual (
510510 str (raised .exception ),
@@ -513,7 +513,7 @@ def test_without_credentials_or_check_credentials(self):
513513
514514 def test_with_credentials_and_check_credentials (self ):
515515 """basic_auth requires only one of credentials and check_credentials."""
516- with self .assertRaises (TypeError ) as raised :
516+ with self .assertRaises (ValueError ) as raised :
517517 basic_auth (
518518 credentials = ("hello" , "iloveyou" ),
519519 check_credentials = lambda : False , # pragma: no cover
0 commit comments