File tree Expand file tree Collapse file tree 2 files changed +42
-7
lines changed Expand file tree Collapse file tree 2 files changed +42
-7
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
-
3
2
"""pytest configuration and top-level fixtures."""
4
3
5
- import pytest
6
4
5
+ import string
7
6
8
- EMAIL_ADDRESSES = [
9
-
10
-
11
- ]
7
+ import pytest
12
8
13
9
14
10
pytest_plugins = [
21
17
'tests.api.test_teammemberships' ,
22
18
'tests.api.test_teams' ,
23
19
'tests.api.test_webhooks' ,
20
+ 'tests.api.test_organizations' ,
21
+ 'tests.api.test_licenses' ,
22
+ 'tests.api.test_roles' ,
24
23
]
25
24
26
25
26
+ TEST_DOMAIN = "cmlccie.com"
27
+
28
+ email_template = string .Template ("test${number}@" + TEST_DOMAIN )
29
+ _email_addresses = []
30
+
31
+
32
+ # Helper Functions
33
+ def new_email_generator ():
34
+ i = 0
35
+ while True :
36
+ email_address = email_template .substitute (number = i )
37
+ _email_addresses .append (email_address )
38
+ i += 1
39
+ yield email_address
40
+
41
+
27
42
# pytest Fixtures
28
43
29
44
@pytest .fixture (scope = "session" )
30
45
def email_addresses ():
31
- return EMAIL_ADDRESSES
46
+ return _email_addresses
47
+
48
+
49
+ @pytest .fixture (scope = "session" )
50
+ def get_email_addresses ():
51
+ def inner_function (num ):
52
+ if len (email_addresses ) < num :
53
+ for i in range (num - len (email_addresses )):
54
+ new_email_address ()
55
+ return email_addresses [:num ]
56
+ return inner_function
57
+
58
+
59
+ @pytest .fixture (scope = "session" )
60
+ def get_new_email_address ():
61
+ generator = new_email_generator ()
62
+ def inner_function ():
63
+ return generator .next ()
64
+ return inner_function
You can’t perform that action at this time.
0 commit comments