File tree Expand file tree Collapse file tree 2 files changed +3
-29
lines changed Expand file tree Collapse file tree 2 files changed +3
-29
lines changed Original file line number Diff line number Diff line change 46
46
if : ${{ startsWith(runner.os, 'macOS') }}
47
47
run : |
48
48
brew tap mongodb/brew
49
- brew install mongodb-community@${MONGODB_VERSION}
49
+ brew install mongodb/brew/mongodb -community@${MONGODB_VERSION}
50
50
brew services start mongodb-community@${MONGODB_VERSION}
51
51
- name : Install package and pytest
52
52
run : |
Original file line number Diff line number Diff line change 1
- import os
2
1
import unittest
3
2
4
3
import flask
5
4
6
5
import flask_pymongo
7
6
8
7
9
- class ToxDockerMixin (object ):
10
8
11
- """
12
- Sets :attr:`port` based on the env var from tox-docker, if present.
13
- """
14
-
15
- def setUp (self ):
16
- super (ToxDockerMixin , self ).setUp ()
17
-
18
- # tox-docker could be running any version; find the env
19
- # var that looks like what tox-docker would provide, but
20
- # fail if there are more than one
21
- env_vars = [
22
- (k , v )
23
- for k , v in os .environ .items ()
24
- if k .startswith ("MONGO" ) and k .endswith ("_TCP_PORT" )
25
- ]
26
-
27
- self .port = 27017
28
- if len (env_vars ) == 1 :
29
- self .port = int (env_vars [0 ][1 ])
30
- else :
31
- self .fail (
32
- f"too many tox-docker mongo port env vars (found { len (env_vars )} )" ,
33
- )
34
-
35
-
36
- class FlaskRequestTest (ToxDockerMixin , unittest .TestCase ):
9
+ class FlaskRequestTest (unittest .TestCase ):
37
10
38
11
def setUp (self ):
39
12
super (FlaskRequestTest , self ).setUp ()
@@ -42,6 +15,7 @@ def setUp(self):
42
15
self .app = flask .Flask ("test" )
43
16
self .context = self .app .test_request_context ("/" )
44
17
self .context .push ()
18
+ self .port = 27017
45
19
46
20
def tearDown (self ):
47
21
super (FlaskRequestTest , self ).tearDown ()
You can’t perform that action at this time.
0 commit comments