Skip to content

Commit

Permalink
test: list unit test dependencies in requirements.txt file (#888)
Browse files Browse the repository at this point in the history
* test: list unit test reqs in requirements.txt file

* chore: update authorized_user.json
  • Loading branch information
busunkim96 committed Oct 15, 2021
1 parent 3a95b4e commit a4cf9b1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
38 changes: 5 additions & 33 deletions noxfile.py
Expand Up @@ -20,30 +20,6 @@

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

TEST_DEPENDENCIES = [
"flask",
"freezegun",
"mock",
"oauth2client",
"pyopenssl",
"pytest",
"pytest-cov",
"pytest-localserver",
"pyu2f",
"requests",
"urllib3",
"cryptography",
"responses",
"grpcio",
]

ASYNC_DEPENDENCIES = [
"pytest-asyncio",
"aioresponses",
"asynctest",
"aiohttp!=3.7.4.post0",
]

BLACK_VERSION = "black==19.3b0"
BLACK_PATHS = [
"google",
Expand Down Expand Up @@ -91,10 +67,8 @@ def unit(session):
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
add_constraints = ["-c", constraints_path]
session.install(*(TEST_DEPENDENCIES + add_constraints))
session.install(*(ASYNC_DEPENDENCIES + add_constraints))
session.install("-e", ".", *add_constraints)
session.install("-r", "testing/requirements.txt", "-c", constraints_path)
session.install("-e", ".", "-c", constraints_path)
session.run(
"pytest",
f"--junitxml=unit_{session.python}_sponge_log.xml",
Expand All @@ -109,8 +83,7 @@ def unit(session):

@nox.session(python="3.7")
def cover(session):
session.install(*TEST_DEPENDENCIES)
session.install(*(ASYNC_DEPENDENCIES))
session.install("-r", "testing/requirements.txt")
session.install("-e", ".")
session.run(
"pytest",
Expand All @@ -128,7 +101,7 @@ def cover(session):
@nox.session(python="3.7")
def docgen(session):
session.env["SPHINX_APIDOC_OPTIONS"] = "members,inherited-members,show-inheritance"
session.install(*TEST_DEPENDENCIES)
session.install("-r", "testing/requirements.txt")
session.install("sphinx")
session.install("-e", ".")
session.run("rm", "-r", "docs/reference")
Expand Down Expand Up @@ -168,8 +141,7 @@ def docs(session):

@nox.session(python="pypy")
def pypy(session):
session.install(*TEST_DEPENDENCIES)
session.install(*ASYNC_DEPENDENCIES)
session.install("-r", "test/requirements.txt")
session.install("-e", ".")
session.run(
"pytest",
Expand Down
Binary file modified system_tests/secrets.tar.enc
Binary file not shown.
20 changes: 20 additions & 0 deletions testing/requirements.txt
@@ -0,0 +1,20 @@
# Unit test requirements
flask
freezegun
mock
oauth2client
pyopenssl
pytest
pytest-cov
pytest-localserver
pyu2f
requests
urllib3
cryptography
responses
grpcio
# Async Dependencies
pytest-asyncio; python_version > '3.0'
aioresponses; python_version > '3.0'
asynctest; python_version > '3.0'
aiohttp; python_version > '3.0'

0 comments on commit a4cf9b1

Please sign in to comment.