          (body (cadr keys-and-body))
          (keys (car keys-and-body)))
     `(ert-deftest ,full-name ()
-       (skip-unless ,(not (plist-get keys :disabled)))
        (ycmd-ert-with-resource-buffer ,filename ,mode
          (let* ((request-backend (or ,(plist-get keys :request-backend)
                                      request-backend))

        (should (= .line_num 5))))))

(ycmd-ert-deftest get-completions-python "test.py" 'python-mode
  :disabled t ;; TODO Find out why this fails sometimes
  :line 7 :column 3
  (let ((response (ycmd-get-completions :sync)))
    (let-alist response
      (should (cl-some (lambda (c)

    (should (string= (ycmd--json-encode data)
                     "{\"foo\":{}}"))))

(defun flycheck-ycmd-test-mode ()
  (flycheck-ycmd-setup)
  (ycmd-test-mode))

(ert-deftest flycheck-ycmd-test-error ()
  (let ((flycheck-checkers '(ycmd)))
    (flycheck-ert-should-syntax-check
     "test-error.cpp" 'flycheck-ycmd-test-mode
     '(3 15 error "expected ';' at end of declaration list (FixIt available)"
         :checker ycmd))))

(ert-deftest flycheck-ycmd-test-warning ()
  (let ((flycheck-checkers '(ycmd)))
    (flycheck-ert-should-syntax-check
     "test-warning.cpp" 'flycheck-ycmd-test-mode
     '(5 13 warning "unused variable 'a'" :checker ycmd))))

(flycheck-ert-initialize ycmd-test-resources-location)

(provide 'ycmd-test)

;;; ycmd-test.el ends here
