Skip to content

Commit

Permalink
Improved code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFeinauer committed Jul 5, 2022
1 parent 5c851a7 commit 16db732
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_django_settings_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,27 @@ def test_ds():
assert result.ret == 0


def test_dch_ini_invalid_path(testdir, monkeypatch) -> None:
monkeypatch.delenv("DJANGO_SETTINGS_MODULE")
testdir.makeini(
"""
[pytest]
DJANGO_CONFIGURATION_HOOK = invalid_path
"""
)
testdir.makepyfile(
"""
import os
def test_ds():
pass
"""
)
result = testdir.runpytest_subprocess()
result.stderr.fnmatch_lines(["ImportError: Invalid path for configuration hook: invalid_path"])
assert result.ret == 1


def test_dch_ini_no_module(testdir, monkeypatch) -> None:
monkeypatch.delenv("DJANGO_SETTINGS_MODULE")
testdir.makeini(
Expand Down

0 comments on commit 16db732

Please sign in to comment.