Skip to content

Commit a4cf9b1

Browse files
authored
test: list unit test dependencies in requirements.txt file (#888)
* test: list unit test reqs in requirements.txt file * chore: update authorized_user.json
1 parent 3a95b4e commit a4cf9b1

File tree

3 files changed

+25
-33
lines changed

3 files changed

+25
-33
lines changed

noxfile.py

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,6 @@
2020

2121
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
2222

23-
TEST_DEPENDENCIES = [
24-
"flask",
25-
"freezegun",
26-
"mock",
27-
"oauth2client",
28-
"pyopenssl",
29-
"pytest",
30-
"pytest-cov",
31-
"pytest-localserver",
32-
"pyu2f",
33-
"requests",
34-
"urllib3",
35-
"cryptography",
36-
"responses",
37-
"grpcio",
38-
]
39-
40-
ASYNC_DEPENDENCIES = [
41-
"pytest-asyncio",
42-
"aioresponses",
43-
"asynctest",
44-
"aiohttp!=3.7.4.post0",
45-
]
46-
4723
BLACK_VERSION = "black==19.3b0"
4824
BLACK_PATHS = [
4925
"google",
@@ -91,10 +67,8 @@ def unit(session):
9167
constraints_path = str(
9268
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
9369
)
94-
add_constraints = ["-c", constraints_path]
95-
session.install(*(TEST_DEPENDENCIES + add_constraints))
96-
session.install(*(ASYNC_DEPENDENCIES + add_constraints))
97-
session.install("-e", ".", *add_constraints)
70+
session.install("-r", "testing/requirements.txt", "-c", constraints_path)
71+
session.install("-e", ".", "-c", constraints_path)
9872
session.run(
9973
"pytest",
10074
f"--junitxml=unit_{session.python}_sponge_log.xml",
@@ -109,8 +83,7 @@ def unit(session):
10983

11084
@nox.session(python="3.7")
11185
def cover(session):
112-
session.install(*TEST_DEPENDENCIES)
113-
session.install(*(ASYNC_DEPENDENCIES))
86+
session.install("-r", "testing/requirements.txt")
11487
session.install("-e", ".")
11588
session.run(
11689
"pytest",
@@ -128,7 +101,7 @@ def cover(session):
128101
@nox.session(python="3.7")
129102
def docgen(session):
130103
session.env["SPHINX_APIDOC_OPTIONS"] = "members,inherited-members,show-inheritance"
131-
session.install(*TEST_DEPENDENCIES)
104+
session.install("-r", "testing/requirements.txt")
132105
session.install("sphinx")
133106
session.install("-e", ".")
134107
session.run("rm", "-r", "docs/reference")
@@ -168,8 +141,7 @@ def docs(session):
168141

169142
@nox.session(python="pypy")
170143
def pypy(session):
171-
session.install(*TEST_DEPENDENCIES)
172-
session.install(*ASYNC_DEPENDENCIES)
144+
session.install("-r", "test/requirements.txt")
173145
session.install("-e", ".")
174146
session.run(
175147
"pytest",

system_tests/secrets.tar.enc

0 Bytes
Binary file not shown.

testing/requirements.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Unit test requirements
2+
flask
3+
freezegun
4+
mock
5+
oauth2client
6+
pyopenssl
7+
pytest
8+
pytest-cov
9+
pytest-localserver
10+
pyu2f
11+
requests
12+
urllib3
13+
cryptography
14+
responses
15+
grpcio
16+
# Async Dependencies
17+
pytest-asyncio; python_version > '3.0'
18+
aioresponses; python_version > '3.0'
19+
asynctest; python_version > '3.0'
20+
aiohttp; python_version > '3.0'

0 commit comments

Comments
 (0)