Skip to content

use doctest-glob instead of doctest-rst and text-file-format - #80

Merged
astrofrog merged 3 commits into
scientific-python:masterfrom
vanyakosmos:feature/doctest-glob
Nov 12, 2019
Merged

astrofrog merged 3 commits into
scientific-python:masterfrom
vanyakosmos:feature/doctest-glob

Conversation

@vanyakosmos

@vanyakosmos vanyakosmos commented Nov 7, 2019 •

Copy link
Copy Markdown
Contributor

close #9
close #48

I marked text-file-format and doctest-rst as deprecated. But right now doctest-glob list is extended with "*.{text_file_format}" if doctest_rst is True. So text-file-format and doctest-rst will still work as expected.

Also comment chars are now determined by file extension instead of text_file_format and can be configured via ini variable text_file_comment_chars

[pytest]
text_file_comment_chars = 
    .rst=#
    .tex=#

default ones are still:

comment_characters = {
    '.txt': '#',
    '.tex': '%',
    '.rst': '..'
}

@vanyakosmos
vanyakosmos force-pushed the feature/doctest-glob branch 4 times, most recently from 9ec8b37 to a69ea38 Compare November 8, 2019 22:21

@astrofrog astrofrog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on board with this but see below for suggestions of wording. For now I'd like to hold off from actually deprecating the options and instead just recommend the --doctest-glob option, and that'll give us time to test out the new option in packages and transition a few before we properly deprecate things here.

Comment thread pytest_doctestplus/plugin.py Outdated
Comment thread pytest_doctestplus/plugin.py Outdated
Comment thread pytest_doctestplus/plugin.py Outdated
@astrofrog

Copy link
Copy Markdown
Contributor

@vanyakosmos - can you rebase this since there is a conflict in the test file due to #84?

@astrofrog astrofrog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@astrofrog
astrofrog merged commit 4ba3424 into scientific-python:master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the comment_characters dictionary configurable Use --doctest-glob instead of custom collector for RST files

2 participants