Skip to content
Snippets Groups Projects
Commit aac8f395 authored by Hugo Winbladh's avatar Hugo Winbladh
Browse files

Drop pytest-mpl

parent 59eb7583
No related branches found
No related tags found
No related merge requests found
Pipeline #100075 passed
Showing
with 14 additions and 10 deletions
......@@ -116,3 +116,4 @@ TODO.txt
b_asic/_version.py
docs_sphinx/_build/
docs_sphinx/examples
result_images/
......@@ -23,7 +23,7 @@ before_script:
.run-test:
stage: test
script:
- pytest --cov=b_asic --cov-report=xml:cov.xml --cov-report=term --cov-branch --color=yes test --mpl --timeout=20 --durations=10
- pytest --cov=b_asic --cov-report=xml:cov.xml --cov-report=term --cov-branch --color=yes test --timeout=20 --durations=10
# - lcov --capture --directory . --output-file coverage.info
# - lcov --output-file coverage.info --extract coverage.info $PWD/src/'*' $PWD/b_asic/'*'
# - lcov --list coverage.info
......
......@@ -127,13 +127,15 @@ pytest
pytest --cov=b_asic --cov-report=html test
```
#### Test including plots
#### Generate new baseline images for the tests
In `B-ASIC`:
```
pytest --mpl
pytest # The image comparison tests will fail
cp -a result_images/* test/baseline_images/
```
### Generating documentation
```
......
pytest
pytest-cov
pytest-qt
pytest-mpl
pytest-timeout
pytest-xvfb
pytest-xdist
test/baseline/test__get_figure_no_execution_times.png

25.3 KiB

test/baseline/test_draw_matrix_transposer_4.png

26.8 KiB

test/baseline/test_draw_process_collection.png

14.7 KiB

test/baseline/test_left_edge_cell_assignment.png

22.5 KiB

test/baseline/test_max_min_lifetime_bar_plot.png

10.8 KiB

test/baseline_images/test_resources/test_draw_matrix_transposer_4.png

46.6 KiB

test/baseline_images/test_resources/test_draw_process_collection.png

25 KiB

test/baseline_images/test_resources/test_left_edge_cell_assignment.png

40.4 KiB

test/baseline_images/test_resources/test_max_min_lifetime_bar_plot.png

17.1 KiB

test/baseline_images/test_schedule/test__get_figure_no_execution_times.png

36.6 KiB

......@@ -2,6 +2,7 @@ import re
import matplotlib.pyplot as plt
import pytest
import matplotlib.testing.decorators
from b_asic.core_operations import ConstantMultiplication
from b_asic.process import PlainMemoryVariable
......@@ -13,13 +14,13 @@ from b_asic.resources import ProcessCollection, _ForwardBackwardTable
class TestProcessCollectionPlainMemoryVariable:
@pytest.mark.mpl_image_compare(style='mpl20')
@matplotlib.testing.decorators.image_comparison(['test_draw_process_collection.png'])
def test_draw_process_collection(self, simple_collection):
fig, ax = plt.subplots()
simple_collection.plot(ax=ax, show_markers=False)
return fig
@pytest.mark.mpl_image_compare(style='mpl20')
@matplotlib.testing.decorators.image_comparison(['test_draw_matrix_transposer_4.png'])
def test_draw_matrix_transposer_4(self):
fig, ax = plt.subplots()
generate_matrix_transposer(4).plot(ax=ax) # type: ignore
......@@ -31,7 +32,7 @@ class TestProcessCollectionPlainMemoryVariable:
)
assert len(collection_split) == 3
@pytest.mark.mpl_image_compare(style='mpl20')
@matplotlib.testing.decorators.image_comparison(['test_left_edge_cell_assignment.png'])
def test_left_edge_cell_assignment(self, simple_collection: ProcessCollection):
fig, ax = plt.subplots(1, 2)
assignment = list(simple_collection._left_edge_assignment())
......@@ -157,7 +158,7 @@ class TestProcessCollectionPlainMemoryVariable:
assert len(simple_collection) == 7
assert new_proc not in simple_collection
@pytest.mark.mpl_image_compare(style='mpl20')
@matplotlib.testing.decorators.image_comparison(['test_max_min_lifetime_bar_plot.png'])
def test_max_min_lifetime_bar_plot(self):
fig, ax = plt.subplots()
collection = ProcessCollection(
......
......@@ -4,6 +4,7 @@ B-ASIC test suite for the schedule module and Schedule class.
import re
import pytest
import matplotlib.testing.decorators
from b_asic.core_operations import Addition, Butterfly, ConstantMultiplication
from b_asic.process import OperatorProcess
......@@ -681,7 +682,7 @@ class TestProcesses:
class TestFigureGeneration:
@pytest.mark.mpl_image_compare(remove_text=True, style='mpl20')
@matplotlib.testing.decorators.image_comparison(['test__get_figure_no_execution_times.png'], remove_text=True)
def test__get_figure_no_execution_times(self, secondorder_iir_schedule):
return secondorder_iir_schedule._get_figure()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment