Skip to content

Commit

Permalink
test and changelog note
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Oct 28, 2024
1 parent e9b1a6e commit ae84c4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Unreleased

* Support Python 3.13.

* Fix crashing on non-existent directories, which Django sometimes tries to watch.

Thanks to baseplate-admin for the report in `Issue #12 <https://github.com/adamchainz/django-watchfiles/issues/12>`__ and Steven Mapes for the fix in `PR #117 <https://github.com/adamchainz/django-watchfiles/pull/117>`__.

0.2.0 (2024-06-19)
------------------

Expand Down
8 changes: 8 additions & 0 deletions tests/test_django_watchfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ def test_tick(self):
result = self.reloader.file_filter(Change.modified, str(test_txt))
assert result is True

def test_tick_non_existent_directory_watched(self):
does_not_exist = self.temp_path / "nope"
self.reloader.watch_dir(does_not_exist, "*.txt")

iterator = self.reloader.tick()
result = next(iterator)
assert result is None


class ReplacedGetReloaderTests(SimpleTestCase):
def test_replaced_get_reloader(self):
Expand Down

0 comments on commit ae84c4e

Please sign in to comment.