summaryrefslogtreecommitdiff
blob: 5cb607c2bb4ca62df9f1e36d8464d9c14bb92ab1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
commit d57060ebaeca8cd38e03cc64f9ee0996e83b50a9
Author: Jonas Haag <jonas@lophus.org>
Date:   Thu Apr 21 08:58:36 2022 +0200

    Move CI to GHA (#3)

--- a/tests.py
+++ b/tests.py
@@ -10,7 +10,7 @@ except ImportError: # Python 2
 
 from httpauth import DictHttpAuthMiddleware, DigestFileHttpAuthMiddleware, md5_str
 
-from nose.tools import raises
+import pytest
 
 
 def parse_dict_header(value):
@@ -121,16 +121,16 @@ def test_without_realm():
     assert 'Digest realm=""' in response.headers['WWW-Authenticate']
 
 
-@raises(ValueError)
 def test_invalid_digestfile_1():
-    DigestFileHttpAuthMiddleware(StringIO('u::realm:hash'),
-                                 wsgi_app=wsgi_app)
+    with pytest.raises(ValueError):
+        DigestFileHttpAuthMiddleware(StringIO('u::realm:hash'),
+                                     wsgi_app=wsgi_app)
 
 
-@raises(ValueError)
 def test_invalid_digestfile_2():
-    DigestFileHttpAuthMiddleware(StringIO('u:realm:hash\nu2:realm2:hash2'),
-                                 wsgi_app=wsgi_app)
+    with pytest.raises(ValueError):
+        DigestFileHttpAuthMiddleware(StringIO('u:realm:hash\nu2:realm2:hash2'),
+                                     wsgi_app=wsgi_app)
 
 
 def test_ticket_1():