-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: Fix largescale pytest mark issue #1553
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0630955
TST: Fix largescale pytest mark issue
kohr-h 2e16dae
Fix testing of examples and sphinx doc similarly
kohr-h ae2b516
Fix pytest dependency for Py2
kohr-h 9968caf
Add py 3.8 to classifiers
kohr-h d8fe980
slow->largescale
kohr-h 707bc21
Support multiple test suites in one run
kohr-h b335eca
Correct text regarding examples suite in testing.rst
kohr-h 8fec014
Use empty list instead of None as pytest -S default
kohr-h File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
[pytest] | ||
minversion = 3.0.3 | ||
markers = not benchmark and not largescale | ||
testpaths = odl | ||
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS | ||
addopts = --doctest-modules | ||
addopts = --doctest-modules --strict-markers | ||
xfail_strict=true | ||
|
||
# PEP8 | ||
pep8ignore = | ||
E402 | ||
pep8maxlinelength = 79 | ||
# Temporary fix for https://github.com/odlgroup/odl/issues/1514, works with pytest<5.1 | ||
filterwarnings = | ||
ignore::pytest.PytestDeprecationWarning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright 2014-2018 The ODL contributors | ||
# Copyright 2014-2020 The ODL contributors | ||
# | ||
# This file is part of ODL. | ||
# | ||
|
@@ -16,26 +16,26 @@ | |
""" | ||
|
||
from __future__ import division | ||
|
||
import doctest | ||
from doctest import IGNORE_EXCEPTION_DETAIL, ELLIPSIS, NORMALIZE_WHITESPACE | ||
import os | ||
from doctest import ELLIPSIS, IGNORE_EXCEPTION_DETAIL, NORMALIZE_WHITESPACE | ||
|
||
import numpy | ||
import pytest | ||
|
||
import odl | ||
from odl.util.testutils import simple_fixture | ||
|
||
try: | ||
import matplotlib | ||
matplotlib.use('Agg') # To avoid the backend freezing | ||
matplotlib.use('agg') # prevent backend from freezing | ||
import matplotlib.pyplot as plt | ||
except ImportError: | ||
pass | ||
|
||
# Modules to be added to testing globals | ||
import numpy | ||
import odl | ||
try: | ||
import proximal | ||
except ImportError: | ||
proximal = None | ||
|
||
doctest_extraglobs = {'odl': odl, 'np': numpy, 'proximal': proximal} | ||
doctest_extraglobs = {'odl': odl, 'np': numpy} | ||
|
||
root_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), | ||
os.pardir, os.pardir, 'doc', 'source') | ||
|
@@ -55,13 +55,10 @@ | |
doc_src_files.append(os.path.join(path, filename)) | ||
|
||
|
||
@pytest.fixture(scope="module", ids=doc_src_files, params=doc_src_files) | ||
def doc_src_file(request): | ||
return request.param | ||
doc_src_file = simple_fixture("doc_src_file", doc_src_files) | ||
|
||
|
||
@pytest.mark.skipif("not pytest.config.getoption('--doctest-doc')", | ||
reason='Need --doctest-doc option to run') | ||
@pytest.mark.suite("doc_doctests") | ||
def test_file(doc_src_file): | ||
# FIXXXME: This doesn't seem to actually test the file :-( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should be TODO :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, new issue I guess |
||
doctest.testfile(doc_src_file, module_relative=False, report=True, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't
'-S largescale'
be more appropriate?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's indeed how you give it on the command line. Here it's just a list of arguments to the call, and from what I've seen it's more common to give it in "already pre-parsed" form, i.e., each argument as a separate element of the list.