Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CHAINER_TEST_PAIRWISE_PARAMETERIZATION and enable it only in Trav…
…is CI
- Loading branch information
Showing
5 changed files
with
30 additions
and
34 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
|
||
from chainer import testing | ||
from chainer.testing import parameterized | ||
|
||
|
||
_pairwise_parameterize = ( | ||
os.environ.get('CHAINER_TEST_PAIRWISE_PARAMETERIZATION', 'never')) | ||
assert _pairwise_parameterize in ('never', 'always') | ||
|
||
|
||
def pytest_collection(session): | ||
# Perform pairwise testing. | ||
# TODO(kataoka): This is a tentative fix. Discuss its public interface. | ||
if _pairwise_parameterize == 'always': | ||
pairwise_product_dict = parameterized._pairwise_product_dict | ||
testing.product_dict = pairwise_product_dict | ||
parameterized.product_dict = pairwise_product_dict | ||
|
||
|
||
def pytest_collection_finish(session): | ||
if _pairwise_parameterize == 'always': | ||
product_dict = parameterized._product_dict_orig | ||
testing.product_dict = product_dict | ||
parameterized.product_dict = product_dict |