Restore duplicate entries in examples app, but test_examples does not duplicate tests

This commit is contained in:
Ogi 2019-06-08 08:07:47 -07:00
parent be0e95ace7
commit f05ff6fbf9
2 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,7 @@ if os.getenv('TRAVIS') is not None:
print("Installed wrapper for flaky print.") print("Installed wrapper for flaky print.")
files = utils.buildFileList(utils.examples) files = sorted(set(utils.buildFileList(utils.examples)))
frontends = {Qt.PYQT4: False, Qt.PYQT5: False, Qt.PYSIDE: False, Qt.PYSIDE2: False} frontends = {Qt.PYQT4: False, Qt.PYQT5: False, Qt.PYSIDE: False, Qt.PYSIDE2: False}
# sort out which of the front ends are available # sort out which of the front ends are available
for frontend in frontends.keys(): for frontend in frontends.keys():
@ -50,7 +50,7 @@ for frontend in frontends.keys():
except ImportError: except ImportError:
pass pass
installed = sorted([frontend for frontend, isPresent in frontends.items() if isPresent]) installedFrontends = sorted([frontend for frontend, isPresent in frontends.items() if isPresent])
exceptionCondition = namedtuple("exceptionCondition", ["condition", "reason"]) exceptionCondition = namedtuple("exceptionCondition", ["condition", "reason"])
conditionalExampleTests = { conditionalExampleTests = {
@ -67,9 +67,9 @@ conditionalExampleTests = {
marks=pytest.mark.skipif(conditionalExampleTests[f[1]].condition is False, marks=pytest.mark.skipif(conditionalExampleTests[f[1]].condition is False,
reason=conditionalExampleTests[f[1]].reason) if f[1] in conditionalExampleTests.keys() else (), reason=conditionalExampleTests[f[1]].reason) if f[1] in conditionalExampleTests.keys() else (),
) )
for frontend, f, in itertools.product(installed, files) for frontend, f, in itertools.product(installedFrontends, files)
], ],
ids = [" {} - {} ".format(f[1], frontend) for frontend, f in itertools.product(installed, files)] ids = [" {} - {} ".format(f[1], frontend) for frontend, f in itertools.product(installedFrontends, files)]
) )
def testExamples(frontend, f, graphicsSystem=None): def testExamples(frontend, f, graphicsSystem=None):
# runExampleFile(f[0], f[1], sys.executable, frontend) # runExampleFile(f[0], f[1], sys.executable, frontend)

View File

@ -15,7 +15,9 @@ examples = OrderedDict([
('Data Slicing', 'DataSlicing.py'), ('Data Slicing', 'DataSlicing.py'),
('Plot Customization', 'customPlot.py'), ('Plot Customization', 'customPlot.py'),
('Image Analysis', 'imageAnalysis.py'), ('Image Analysis', 'imageAnalysis.py'),
('ViewBox Features', 'ViewBoxFeatures.py'),
('Dock widgets', 'dockarea.py'), ('Dock widgets', 'dockarea.py'),
('Console', 'ConsoleWidget.py'),
('Histograms', 'histogram.py'), ('Histograms', 'histogram.py'),
('Beeswarm plot', 'beeswarm.py'), ('Beeswarm plot', 'beeswarm.py'),
('Symbols', 'Symbols.py'), ('Symbols', 'Symbols.py'),