|
1 | 1 | import os
|
2 |
| -from typing import Iterable |
3 | 2 |
|
4 | 3 | import nox
|
5 | 4 | from nox.sessions import Session
|
|
10 | 9 |
|
11 | 10 |
|
12 | 11 | @nox.session
|
13 |
| -def test_without_coverage(session: Session) -> None: |
14 |
| - _test_setup(session) |
| 12 | +def test_suite(session: Session) -> None: |
| 13 | + session.env.update(os.environ) |
| 14 | + session.install("-r", "requirements/test-env.txt") |
15 | 15 | session.install(".[all]")
|
16 |
| - _test_run(session, extra_args=["--no-cov"]) |
17 |
| - |
18 |
| - |
19 |
| -@nox.session |
20 |
| -def test_with_coverage(session: Session) -> None: |
21 |
| - _test_setup(session) |
22 |
| - session.install("-e", ".[all]") # coverage requires a dev install |
23 |
| - _test_run(session) |
| 16 | + args = ["pytest", "tests"] |
| 17 | + if HEADLESS: |
| 18 | + args.append("--headless") |
| 19 | + session.run(*args) |
24 | 20 |
|
25 | 21 |
|
26 | 22 | @nox.session
|
@@ -49,16 +45,3 @@ def build_docs(session: Session) -> None:
|
49 | 45 | session.install("-e", ".[all]")
|
50 | 46 | session.run("sphinx-build", "-b", "html", "docs/source", "docs/build")
|
51 | 47 | session.run("sphinx-build", "-b", "doctest", "docs/source", "docs/build")
|
52 |
| - |
53 |
| - |
54 |
| -def _test_setup(session: Session) -> None: |
55 |
| - session.env.update(os.environ) |
56 |
| - session.install("-r", "requirements/test-env.txt") |
57 |
| - |
58 |
| - |
59 |
| -def _test_run(session: Session, extra_args: Iterable[str] = ()) -> None: |
60 |
| - args = ["pytest", "tests"] |
61 |
| - if HEADLESS: |
62 |
| - args.append("--headless") |
63 |
| - args.extend(extra_args) |
64 |
| - session.run(*args) |
0 commit comments