Repository: matplotlib/matplotlib
File: lib/matplotlib/tests/test_datetime.py (Python)

Code before:

    @pytest.mark.xfail(reason="Test for tricontour not written yet")
    @mpl.style.context("default")
    def test_tricontour(self):
        fig, ax = plt.subplots()
        ax.tricontour(...)

    @pytest.mark.xfail(reason="Test for tricontourf not written yet")
    @mpl.style.context("default")
    def test_tricontourf(self):
        fig, ax = plt.subplots()
        ax.tricontourf(...)

    @pytest.mark.xfail(reason="Test for tripcolor not written yet")
    @mpl.style.context("default")
    def test_tripcolor(self):
        fig, ax = plt.subplots()
        ax.tripcolor(...)

    @pytest.mark.xfail(reason="Test for triplot not written yet")
    @mpl.style.context("default")
    def test_triplot(self):
        fig, ax = plt.subplots()
        ax.triplot(...)

    @pytest.mark.parametrize(("orientation"), ["vertical", "horizontal"])
    @mpl.style.context("default")
    def test_violin(self, orientation):
        fig, ax = plt.subplots()
        datetimes = [
            datetime.datetime(2023, 2, 10),
            datetime.datetime(2023, 5, 18),
            datetime.datetime(2023, 6, 6)
        ]
        ax.violin(
            [
                {
                    'coords': datetimes,
                    'vals': [0.1, 0.5, 0.2],
                    'mean': datetimes[1],
                    'median': datetimes[1],
                    'min': datetimes[0],
                    'max': datetimes[-1],
                    'quantiles': datetimes
                }
            ],
            orientation=orientation,
            # TODO: It should be possible for positions to be datetimes too
            # https://github.com/matplotlib/matplotlib/issues/30417
            # positions=[datetime.datetime(2020, 1, 1)]
        )

Review comment (suggestion):
Superfluous parentheses.
```suggestion
    @pytest.mark.parametrize("orientation", ["vertical", "horizontal"])
```

Code after:

    @pytest.mark.xfail(reason="Test for tricontour not written yet")
    @mpl.style.context("default")
    def test_tricontour(self):
        fig, ax = plt.subplots()
        ax.tricontour(...)

    @pytest.mark.xfail(reason="Test for tricontourf not written yet")
    @mpl.style.context("default")
    def test_tricontourf(self):
        fig, ax = plt.subplots()
        ax.tricontourf(...)

    @pytest.mark.xfail(reason="Test for tripcolor not written yet")
    @mpl.style.context("default")
    def test_tripcolor(self):
        fig, ax = plt.subplots()
        ax.tripcolor(...)

    @pytest.mark.xfail(reason="Test for triplot not written yet")
    @mpl.style.context("default")
    def test_triplot(self):
        fig, ax = plt.subplots()
        ax.triplot(...)

    @pytest.mark.parametrize("orientation", ["vertical", "horizontal"])
    @mpl.style.context("default")
    def test_violin(self, orientation):
        fig, ax = plt.subplots()
        datetimes = [
            datetime.datetime(2023, 2, 10),
            datetime.datetime(2023, 5, 18),
            datetime.datetime(2023, 6, 6)
        ]
        ax.violin(
            [
                {
                    'coords': datetimes,
                    'vals': [0.1, 0.5, 0.2],
                    'mean': datetimes[1],
                    'median': datetimes[1],
                    'min': datetimes[0],
                    'max': datetimes[-1],
                    'quantiles': datetimes
                }
            ],
            orientation=orientation,
            # TODO: It should be possible for positions to be datetimes too
            # https://github.com/matplotlib/matplotlib/issues/30417
            # positions=[datetime.datetime(2020, 1, 1)]
        )