Skip to content

Commit d9f84e4

Browse files
committed
fixups
1 parent c1f0729 commit d9f84e4

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
if: ${{ startsWith(runner.os, 'macOS') }}
4747
run: |
4848
brew tap mongodb/brew
49-
brew install mongodb-community@${MONGODB_VERSION}
49+
brew install mongodb/brew/mongodb-community@${MONGODB_VERSION}
5050
brew services start mongodb-community@${MONGODB_VERSION}
5151
- name: Install package and pytest
5252
run: |

flask_pymongo/tests/util.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,12 @@
1-
import os
21
import unittest
32

43
import flask
54

65
import flask_pymongo
76

87

9-
class ToxDockerMixin(object):
108

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):
3710

3811
def setUp(self):
3912
super(FlaskRequestTest, self).setUp()
@@ -42,6 +15,7 @@ def setUp(self):
4215
self.app = flask.Flask("test")
4316
self.context = self.app.test_request_context("/")
4417
self.context.push()
18+
self.port = 27017
4519

4620
def tearDown(self):
4721
super(FlaskRequestTest, self).tearDown()

0 commit comments

Comments
 (0)