-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnoxfile.py
74 lines (67 loc) · 2.27 KB
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
"""nox config for pytekukko."""
import nox
nox.options.error_on_external_run = True
@nox.session(python=[f"{py}3.{x}" for py in ("", "pypy") for x in range(10, 15)])
def test(session: nox.Session) -> None:
"""Run tests."""
session.install(".[examples]", "-r", "requirements/test-requirements.txt")
known_deprecations = [
"-W",
( # https://github.com/pytest-dev/pytest-asyncio/issues/929, slated for 1.0
"default:'asyncio.iscoroutinefunction':"
"DeprecationWarning:pytest_asyncio.plugin"
),
"-W",
( # https://github.com/pytest-dev/pytest-asyncio/issues/1025
r"default:'asyncio.get_event_loop_policy':"
"DeprecationWarning:pytest_asyncio.plugin"
),
"-W",
( # https://github.com/pytest-dev/pytest-asyncio/issues/1025
r"default:'asyncio.set_event_loop_policy':"
"DeprecationWarning:pytest_asyncio.plugin"
),
"-W",
( # https://github.com/aio-libs/aiohttp/pull/7302, included in aiohttp >= 3.9
"default:datetime.datetime.utcfromtimestamp:"
"DeprecationWarning:aiohttp.cookiejar"
),
"-W",
( # aiohttp 3.8.6 in -X dev mode
"default:"
"Setting custom ClientSession._resolve_charset attribute is discouraged:"
"DeprecationWarning:aiohttp.client"
),
"-W",
( # https://github.com/dateutil/dateutil/pull/1285, dateutil <= 2.8.2
"default:datetime.datetime.utcfromtimestamp:"
"DeprecationWarning:dateutil.tz.tz"
),
]
cmd = ["python3", "-X", "dev", "-bb"]
session.run(*cmd, "-m", "pytest", *known_deprecations, *session.posargs)
cmd += ["-W", "error", *known_deprecations, "-m"]
session.run(
*cmd,
"pytekukko.examples.print_collection_schedules",
"--help",
silent=True,
)
session.run(
*cmd,
"pytekukko.examples.print_invoice_headers",
"--help",
silent=True,
)
session.run(
*cmd,
"pytekukko.examples.print_next_collections",
"--help",
silent=True,
)
session.run(
*cmd,
"pytekukko.examples.update_google_calendar",
"--help",
silent=True,
)