Skip to content

Commit

Permalink
Deploying to gh-pages from @ a3150db 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Oct 2, 2023
1 parent 5e68125 commit 0483961
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
Binary file modified docs/latest/en/.doctrees/environment.pickle
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/latest/en/pytest-lsp/guide/testing-json-rpc-servers.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h2>The Client Fixture<a class="headerlink" href="#the-client-fixture" title="Li
<section id="writing-test-cases">
<h2>Writing Test Cases<a class="headerlink" href="#writing-test-cases" title="Link to this heading">#</a></h2>
<p>With the client fixuture defined, test cases are written almost identically as they would be for your LSP servers.
The only difference is that the generic <code class="xref py py-meth docutils literal notranslate"><span class="pre">send_request_async()</span></code> and <code class="xref py py-meth docutils literal notranslate"><span class="pre">notify()</span></code> methods are used to communicate with the server.</p>
The only difference is that the generic <a class="reference external" href="https://pygls.readthedocs.io/en/latest/pages/reference/protocol.html#pygls.protocol.JsonRPCProtocol.send_request_async" title="(in pygls v1.1.0)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">send_request_async()</span></code></a> and <a class="reference external" href="https://pygls.readthedocs.io/en/latest/pages/reference/protocol.html#pygls.protocol.JsonRPCProtocol.notify" title="(in pygls v1.1.0)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">notify()</span></code></a> methods are used to communicate with the server.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@pytest</span><span class="o">.</span><span class="n">mark</span><span class="o">.</span><span class="n">asyncio</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">test_add</span><span class="p">(</span><span class="n">client</span><span class="p">:</span> <span class="n">JsonRPCClient</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Ensure that the server implements addition correctly.&quot;&quot;&quot;</span>
Expand All @@ -331,7 +331,7 @@ <h2>Writing Test Cases<a class="headerlink" href="#writing-test-cases" title="Li
<span class="k">assert</span> <span class="n">result</span><span class="o">.</span><span class="n">total</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span>
</pre></div>
</div>
<p>However, it is also possible to extend the base <a class="reference external" href="https://pygls.readthedocs.io/en/latest/pages/reference/clients.html#pygls.client.JsonRPCClient" title="(in pygls v1.0.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">JsonRPCClient</span></code></a> to provide a higher level interface to your server.
<p>However, it is also possible to extend the base <a class="reference external" href="https://pygls.readthedocs.io/en/latest/pages/reference/clients.html#pygls.client.JsonRPCClient" title="(in pygls v1.1.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">JsonRPCClient</span></code></a> to provide a higher level interface to your server.
See the <a class="reference external" href="https://github.com/swyddfa/esbonio/blob/develop/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py">SubprocessSphinxClient</a> from the <a class="reference external" href="https://github.com/swyddfa/esbonio">esbonio</a> project for such an example.</p>
</section>
</section>
Expand Down
Loading

0 comments on commit 0483961

Please sign in to comment.