summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-18 21:24:00 +0100
committerGeorg Brandl <georg@python.org>2021-01-18 22:08:36 +0100
commit2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch)
tree809c0b4a686db98f5954afa1944404cd9652c6b2 /doc
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'doc')
-rw-r--r--doc/docs/lexerdevelopment.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst
index 824e0c59..5aa6ea4b 100644
--- a/doc/docs/lexerdevelopment.rst
+++ b/doc/docs/lexerdevelopment.rst
@@ -168,15 +168,18 @@ Finally the lexer can be made publicly known by rebuilding the lexer mapping:
$ make mapfiles
To test the new lexer, store an example file with the proper extension in
-``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
-``tests/examplefiles/example.diff`` containing a sample diff output.
+``tests/lexers/<alias>/example.txt``. For example, to test your ``DiffLexer``,
+add a ``tests/lexers/diff/example.txt`` containing a sample diff output. To
+(re)generate the lexer output which the file is checked against, also stored in
+the file, use the command ``pytest tests/lexers/<alias>/example.txt
+--update-goldens``.
Now you can use ``python -m pygments`` from the current root of the checkout to
render your example to HTML:
.. code-block:: console
- $ python -m pygments -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
+ $ python -m pygments -O full -l diff -f html -o /tmp/example.html tests/lexers/diff/example.txt
Note that this explicitly calls the ``pygments`` module in the current
directory. This ensures your modifications are used. Otherwise a possibly