File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 66except ImportError :
77 import unittest
88
9- from bpython .curtsiesfrontend .filewatch import ModuleChangedEventHandler
9+ try :
10+ from bpython .curtsiesfrontend .filewatch import ModuleChangedEventHandler
11+ has_watchdog = True
12+ except ImportError :
13+ has_watchdog = False
1014
15+ @unittest .skipIf (not has_watchdog , "watchdog not available" )
1116class TestModuleChangeEventHandler (unittest .TestCase ):
12-
17+
1318 def setUp (self ):
1419 self .module = ModuleChangedEventHandler ([], 1 )
1520 self .module .observer = mock .Mock ()
16-
21+
1722 def test_create_module_handler (self ):
1823 self .assertIsInstance (self .module , ModuleChangedEventHandler )
19-
24+
2025 def test_add_module (self ):
2126 self .module ._add_module ('something/test.py' )
22- self .assertIn (os .path .abspath ('something/test' ),
27+ self .assertIn (os .path .abspath ('something/test' ),
2328 self .module .dirs [os .path .abspath ('something' )])
24-
29+
2530 def test_activate_throws_error_when_already_activated (self ):
2631 self .module .activated = True
2732 with self .assertRaises (ValueError ):
2833 self .module .activate ()
29-
30-
34+
You can’t perform that action at this time.
0 commit comments