Skip to content

Commit 32c9b09

Browse files
committed
ensure configure is called when pre-compilin
1 parent ed14b8d commit 32c9b09

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,4 @@ COPY . /opt/warehouse/src/
238238
RUN tldextract --update
239239
# Load our module to pre-compile as much bytecode as we can easily.
240240
# Saves time collectively on container boot!
241-
RUN python -m warehouse -h
241+
RUN python -m warehouse db -h

tests/unit/cli/test_cli.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,21 @@ def cli_test_command(obj):
3333

3434
result = cli.invoke(warehouse.cli.warehouse, ["cli-test-command"])
3535

36+
assert result.exit_code == 2
37+
assert configure.calls == []
38+
39+
40+
def test_cli_help(monkeypatch, cli):
41+
config = pretend.stub()
42+
configure = pretend.call_recorder(lambda: config)
43+
monkeypatch.setattr(warehouse.cli, "LazyConfig", configure)
44+
45+
@warehouse.cli.warehouse.command()
46+
@click.pass_obj
47+
def cli_test_command(obj):
48+
assert obj is config
49+
50+
result = cli.invoke(warehouse.cli.warehouse, ["db", "-h"])
51+
3652
assert result.exit_code == 0
3753
assert configure.calls == [pretend.call()]

0 commit comments

Comments
 (0)