| 1 |
From: =?utf-8?q?Pierre-Elliott_B=C3=A9cue?= <[email protected]> |
| 2 |
Date: Wed, 16 May 2018 10:20:38 +0200 |
| 3 |
Subject: Add the repr_str attribute to the test add_count function |
| 4 |
|
| 5 |
Without, the following traceback happen |
| 6 |
====================================================================== |
| 7 |
ERROR: test_watch_file (tests.test_watcher.TestWatcher) |
| 8 |
---------------------------------------------------------------------- |
| 9 |
Traceback (most recent call last): |
| 10 |
File "/tmp/autopkgtest.2Pi2SP/build.cBN/python-livereload-2.5.2/tests/test_watcher.py", line 66, in test_watch_file |
| 11 |
rv = watcher.examine() |
| 12 |
File "/tmp/autopkgtest.2Pi2SP/build.cBN/python-livereload-2.5.2/livereload/watcher.py", line 92, in examine |
| 13 |
func.repr_str, delay)) |
| 14 |
AttributeError: 'function' object has no attribute 'repr_str' |
| 15 |
--- |
| 16 |
tests/test_watcher.py | 2 ++ |
| 17 |
1 file changed, 2 insertions(+) |
| 18 |
|
| 19 |
diff --git a/tests/test_watcher.py b/tests/test_watcher.py |
| 20 |
index 07ee21c..a91029f 100644 |
| 21 |
--- a/tests/test_watcher.py |
| 22 |
+++ b/tests/test_watcher.py |
| 23 |
@@ -62,6 +62,8 @@ class TestWatcher(unittest.TestCase): |
| 24 |
def add_count(): |
| 25 |
watcher.count += 1 |
| 26 |
|
| 27 |
+ add_count.repr_str = "add_count" |
| 28 |
+ |
| 29 |
watcher.watch(filepath, add_count) |
| 30 |
assert watcher.is_changed(filepath) |
| 31 |
assert watcher.is_changed(filepath) is False |