Ben Bass avatar Ben Bass committed 7394e5e

fix ignore_count semantics (off-by-one)

Comments (0)

Files changed (2)

rpcpdb/test_server.py

             print(p)
             time.sleep(0.1)
 
+
 def main():
     ps = PrimeServer()
     # test basic parameter criteria match
-    t = threading.Thread(target = ps.mainloop)
+    t = threading.Thread(target=ps.mainloop)
     t.daemon = True
     t.start()
     time.sleep(2)
     terminal(ps.debug_func('next_prime',
-                           match_criteria={'p':97}))
+                           match_criteria={'p': 97}))
+    terminal(ps.debug_func('next_prime',
+                           ignore_count=5))
     t.join()
 
     # test keyword criteria match
     t.start()
     terminal(ps.debug_func('test_func',
                            match_criteria={'thing': 'hello'}))
+    terminal(ps.debug_func('test_func',
+                           match_criteria={'thing': 'hello'}))
     time.sleep(1)
     t.join()
 
 if __name__ == '__main__':
-    main()
+    main()
 
             def debug_check(*o, **k):
                 if arg_match(o, k):
-                    debug_check._ignore_count -= 1
                     if debug_check._ignore_count <= 0:
                         if once:
                             self.undebug_func(f)
                         with UPdb(pdb_sock_path, level=1, force=force):
                             return func(*o, **k)
+                    debug_check._ignore_count -= 1
                 # we're not debugging you, this time...
                 return func(*o, **k)
             # use a function attribute to store the skip count;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.