Repository: Universite-Gustave-Eiffel/acoustic-toolbox (language: python)

Issue:
use classes in tests



Discussion / hints:

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index 3acfc6a..f01bc87 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -50,4 +50,5 @@ universal = true
 dev-dependencies = [
     "ruff>=0.5.5",
     "pytest>=8.3.2",
+    "coverage>=7.6.0",
 ]
diff --git a/requirements-dev.lock b/requirements-dev.lock
index f4932c5..d977247 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -49,6 +49,7 @@ comm==0.2.2
     # via ipywidgets
 contourpy==1.2.1
     # via matplotlib
+coverage==7.6.0
 cycler==0.12.1
     # via matplotlib
 debugpy==1.8.2


Test patch:
diff --git a/tests/get_data_path.py b/tests/get_data_path.py
index 1575817..a81bb8a 100644
--- a/tests/get_data_path.py
+++ b/tests/get_data_path.py
@@ -1,4 +1,3 @@
-import os
 import pathlib
 
 
diff --git a/tests/test__signal.py b/tests/test__signal.py
index b03aec2..ea816aa 100644
--- a/tests/test__signal.py
+++ b/tests/test__signal.py
@@ -3,15 +3,9 @@
 import pytest
 import tempfile
 
-import itertools as it
 from acoustic_toolbox.signal import EqualBand
 import matplotlib.pyplot as plt
 
-#def test_operator():
-
-    #n = 10000
-    #fs = 5000
-
 
 def test_wav():
     """Test writing to and reading from wav file."""
diff --git a/tests/test_atmosphere.py b/tests/test_atmosphere.py
index 41d46ef..0d1ebef 100644
--- a/tests/test_atmosphere.py
+++ b/tests/test_atmosphere.py
@@ -1,30 +1,32 @@
 import numpy as np
 from acoustic_toolbox.atmosphere import Atmosphere
 
-import sys
-sys.path.append('..')
-from get_data_path import data_path
+from tests.get_data_path import data_path
 
 
 class TestAtmosphere:
-    def test_standard_atmosphere(self):
+    """
+    Test :mod:`acoustic_toolbox.atmosphere`
+    """
 
+    def test_standard_atmosphere(self):
         a = Atmosphere()
         """Default values."""
-        assert (a.temperature == 293.15)
-        assert (a.pressure == 101.325)
-        assert (a.relative_humidity == 0.0)
+        assert a.temperature == 293.15
+        assert a.pressure == 101.325
+        assert a.relative_humidity == 0.0
         """Calculated values belonging to default values."""
-        assert (abs(a.soundspeed - 343.2) < 1.0e-9)
-        assert (abs(a.saturation_pressure - 2.33663045) < 1.0e-8)
-        assert (abs(a.molar_concentration_water_vapour - 0.0) < 1.0e-9)
-        assert (abs(a.relaxation_frequency_nitrogen - 9.0) < 1.0e-9)
-        assert (abs(a.relaxation_frequency_oxygen - 24.0) < 1.0e-9)
+        assert abs(a.soundspeed - 343.2) < 1.0e-9
+        assert abs(a.saturation_pressure - 2.33663045) < 1.0e-8
+        assert abs(a.molar_concentration_water_vapour - 0.0) < 1.0e-9
+        assert abs(a.relaxation_frequency_nitrogen - 9.0) < 1.0e-9
+        assert abs(a.relaxation_frequency_oxygen - 24.0) < 1.0e-9
 
     def test_attenuation_coefficient(self):
         """Test data is all at an air pressure of one standard atmosphere, 101.325 Pa."""
-        data = np.loadtxt(data_path() / 'absorption_coefficient.csv', skiprows=1, delimiter=',')
-
+        data = np.loadtxt(
+            data_path() / "absorption_coefficient.csv", skiprows=1, delimiter=","
+        )
         f = np.array([
             50.0, 63.0, 80.0, 100.0, 125.0, 160.0, 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0,
             1600.0, 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0
diff --git a/tests/test_bands.py b/tests/test_bands.py
index 89ecf61..a0f83ac 100644
--- a/tests/test_bands.py
+++ b/tests/test_bands.py
@@ -18,101 +18,90 @@ def third_real():
         2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500, 16000, 20000
     ])
 
-
-def test_octave(octave_real):
-    generated = octave(16, 16000)
-    real = octave_real
-    assert_array_equal(generated, real)
-
-
-def test_octave_high(octave_real):
-    generated = octave_high(16, 16000)
-    real = octave_real * np.sqrt(2)
-    assert_array_almost_equal(generated, real)
-
-
-def test_octave_low(octave_real):
-    generated = octave_low(16, 16000)
-    real = real = octave_real / np.sqrt(2)
-    assert_array_almost_equal(generated, real)
-
-
-def test_third(third_real):
-    generated = third(12.5, 20000)
-    real = third_real
-    assert_array_equal(generated, real)
-
-
-def test_third_high(third_real):
-    generated = third_high(12.5, 20000)
-    real = third_real * 2**(1 / 6)
-    assert_array_almost_equal(generated, real)
-
-
-def test_third_low(third_real):
-    generated = third_low(12.5, 20000)
-    real = third_real / 2**(1 / 6)
-    assert_array_almost_equal(generated, real)
-
-
-def test_third2oct():
-
-    levels = np.array([10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0])
-    generated = third2oct(levels)
-    real = np.array([14.77121255, 14.77121255, 14.77121255])
-    assert_array_almost_equal(generated, real)
-
-
-def test_third2oct_2darray_axis0():
-    levels = np.array([[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
-                       [10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0],
-                       [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]])
-    generated = third2oct(levels, axis=0)
-    real = np.array([100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0])
-    assert_array_almost_equal(generated, real)
-
-
-def test_third2oct_2darray_axis1():
-    levels = np.array([[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
-                       [10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0],
-                       [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]])
-    generated = third2oct(levels, axis=1)
-    real = np.array([[5.77121255, 5.77121255, 5.77121255], [14.77121255, 14.77121255, 14.77121255],
-                     [104.77121255, 104.77121255, 104.77121255]])
-    assert_array_almost_equal(generated, real)
-
-
-def test_third2oct_3darray_axis0():
-
-    # Array of ones with shape (3,4,5)
-    levels = np.array([[[1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.]],
-                       [[1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.]],
-                       [[1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.]]])
-
-    generated = third2oct(levels, axis=0)
-    real = np.array([[5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255],
-                     [5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255],
-                     [5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255],
-                     [5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255]])
-    assert_array_almost_equal(generated, real)
-
-
-def test_third2oct_2darray():
-    levels = np.array([[100, 95, 80, 55, 65, 85, 75, 70, 90, 95, 105, 110],
-                       [100, 95, 80, 55, 65, 85, 75, 70, 90, 95, 105, 110]])
-    generated = third2oct(levels, axis=1)
-    real = np.array([[101.22618116, 85.04751156, 90.17710468, 111.29641738],
-                     [101.22618116, 85.04751156, 90.17710468, 111.29641738]])
-    assert_array_almost_equal(generated, real)
-
-
-@pytest.mark.parametrize("freqs, expected", [
-    (np.array([125, 250, 500]), 'octave'),
-    (np.array([12.5, 16, 20]), 'third'),
-    (np.array([125, 250, 1000, 4000]), 'octave-unsorted'),
-    (np.array([12.5, 800, 500, 5000]), 'third-unsorted'),
-    (np.array([100, 200, 300, 400]), None),
-])
-def test__check_band_type(freqs, expected):
-    band_type = _check_band_type(freqs)
-    assert_array_equal(band_type, expected)
+class TestBands:
+    """
+    Test :mod:`acoustic_toolbox.bands`
+    """
+
+    def test_octave(self, octave_real):
+        generated = octave(16, 16000)
+        real = octave_real
+        assert_array_equal(generated, real)
+
+    def test_octave_high(self, octave_real):
+        generated = octave_high(16, 16000)
+        real = octave_real * np.sqrt(2)
+        assert_array_almost_equal(generated, real)
+
+    def test_octave_low(self, octave_real):
+        generated = octave_low(16, 16000)
+        real = real = octave_real / np.sqrt(2)
+        assert_array_almost_equal(generated, real)
+
+    def test_third(self, third_real):
+        generated = third(12.5, 20000)
+        real = third_real
+        assert_array_equal(generated, real)
+
+    def test_third_high(self, third_real):
+        generated = third_high(12.5, 20000)
+        real = third_real * 2**(1 / 6)
+        assert_array_almost_equal(generated, real)
+
+    def test_third_low(self, third_real):
+        generated = third_low(12.5, 20000)
+        real = third_real / 2**(1 / 6)
+        assert_array_almost_equal(generated, real)
+
+    def test_third2oct(self):
+        levels = np.array([10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0])
+        generated = third2oct(levels)
+        real = np.array([14.77121255, 14.77121255, 14.77121255])
+        assert_array_almost_equal(generated, real)
+
+    def test_third2oct_2darray_axis0(self):
+        levels = np.array([[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
+                            [10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0],
+                            [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]])
+        generated = third2oct(levels, axis=0)
+        real = np.array([100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0])
+        assert_array_almost_equal(generated, real)
+
+    def test_third2oct_2darray_axis1(self):
+        levels = np.array([[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
+                            [10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0],
+                            [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]])
+        generated = third2oct(levels, axis=1)
+        real = np.array([[5.77121255, 5.77121255, 5.77121255], [14.77121255, 14.77121255, 14.77121255],
+                            [104.77121255, 104.77121255, 104.77121255]])
+        assert_array_almost_equal(generated, real)
+
+    def test_third2oct_3darray_axis0(self):
+        levels = np.array([[[1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.]],
+                            [[1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.]],
+                            [[1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.], [1., 1., 1., 1., 1.]]])
+        generated = third2oct(levels, axis=0)
+        real = np.array([[5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255],
+                            [5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255],
+                            [5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255],
+                            [5.77121255, 5.77121255, 5.77121255, 5.77121255, 5.77121255]])
+        assert_array_almost_equal(generated, real)
+
+    def test_third2oct_2darray(self):
+        levels = np.array([[100, 95, 80, 55, 65, 85, 75, 70, 90, 95, 105, 110],
+                            [100, 95, 80, 55, 65, 85, 75, 70, 90, 95, 105, 110]])
+        generated = third2oct(levels, axis=1)
+        real = np.array([[101.22618116, 85.04751156, 90.17710468, 111.29641738],
+                            [101.22618116, 85.04751156, 90.17710468, 111.29641738]])
+        assert_array_almost_equal(generated, real)
+
+    @pytest.mark.parametrize("freqs, expected", [
+        (np.array([125, 250, 500]), 'octave'),
+        (np.array([12.5, 16, 20]), 'third'),
+        (np.array([125, 250, 1000, 4000]), 'octave-unsorted'),
+        (np.array([12.5, 800, 500, 5000]), 'third-unsorted'),
+        (np.array([100, 200, 300, 400]), None),
+    ])
+    def test__check_band_type(self, freqs, expected):
+        band_type = _check_band_type(freqs)
+        assert_array_equal(band_type, expected)
diff --git a/tests/test_building.py b/tests/test_building.py
index e39871b..df754e3 100644
--- a/tests/test_building.py
+++ b/tests/test_building.py
@@ -1,66 +1,76 @@
 import numpy as np
 from numpy.testing import assert_almost_equal, assert_array_almost_equal
-
 import pytest
 
-from acoustic_toolbox.building import (rw_curve, rw, rw_c, rw_ctr, stc, stc_curve,
-                                mass_law)
+from acoustic_toolbox.building import (
+    rw_curve,
+    rw,
+    rw_c,
+    rw_ctr,
+    stc,
+    stc_curve,
+    mass_law,
+)
+
 
 @pytest.fixture
 def tl():
-    return np.array([10, 11, 12, 13, 15, 18, 20, 20, 25, 22, 18, 15,
-                            20, 25, 28, 30])
-
-
-def test_rw_curve(tl):
-    calculated = rw_curve(tl)
-    real = np.array([3, 6, 9, 12, 15, 18, 21, 22, 23, 24, 25, 26, 26,
-                     26, 26, 26])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_rw(tl):
-    calculated = rw(tl)
-    real = 22
-    assert_almost_equal(calculated, real)
-
-
-def test_rw_c(tl):
-    calculated = rw_c(tl)
-    real = 19.657473180
-    assert_almost_equal(calculated, real)
-
-
-def test_rw_ctr(tl):
-    calculated = rw_ctr(tl)
-    real = 18.036282792
-    assert_almost_equal(calculated, real)
-
-
-def test_stc(tl):
-    tl = np.array([18, 18, 17, 17, 20, 21, 22, 23, 25, 26, 26, 25, 25, 26,
-                   30, 31])
-    calculated = stc(tl)
-    real = 25
-    assert_almost_equal(calculated, real)
-
-
-def test_stc_curve(tl):
-    tl = np.array([18, 18, 17, 17, 20, 21, 22, 23, 25, 26, 26, 25, 25, 26,
-                   30, 31])
-    calculated = stc_curve(tl)
-    real = np.array([9, 12, 15, 18, 21, 24, 25, 26, 27, 28, 29, 29, 29, 29,
-                     29, 29])
-    assert_array_almost_equal(calculated, real)
-
-
-@pytest.mark.parametrize("freq, vol_density, thickness, theta, c, rho0, \
-                         expected", [
-    (200, 2000, 0.005, 0, 343, 1.225, 23.514371494),
-    (150, 8000, 0.002, 20, 345, 1.18, 24.827231087),
-    (np.array([200, 150]), 8000, 0.002, 20, 345, 1.18,
-     np.array([27.319749023, 24.827231087])),
-])
-def test_mass_law(freq, vol_density, thickness, theta, c, rho0, expected):
-    calculated = mass_law(freq, vol_density, thickness, theta, c, rho0)
-    assert_array_almost_equal(calculated, expected)
+    return np.array([10, 11, 12, 13, 15, 18, 20, 20, 25, 22, 18, 15, 20, 25, 28, 30])
+
+
+class TestBuilding:
+    """
+    Test :mod:`acoustic_toolbox.building`
+    """
+
+    def test_rw_curve(self, tl):
+        calculated = rw_curve(tl)
+        real = np.array([3, 6, 9, 12, 15, 18, 21, 22, 23, 24, 25, 26, 26, 26, 26, 26])
+        assert_array_almost_equal(calculated, real)
+
+    def test_rw(self, tl):
+        calculated = rw(tl)
+        real = 22
+        assert_almost_equal(calculated, real)
+
+    def test_rw_c(self, tl):
+        calculated = rw_c(tl)
+        real = 19.657473180
+        assert_almost_equal(calculated, real)
+
+    def test_rw_ctr(self, tl):
+        calculated = rw_ctr(tl)
+        real = 18.036282792
+        assert_almost_equal(calculated, real)
+
+    def test_stc(self, tl):
+        tl = np.array([18, 18, 17, 17, 20, 21, 22, 23, 25, 26, 26, 25, 25, 26, 30, 31])
+        calculated = stc(tl)
+        real = 25
+        assert_almost_equal(calculated, real)
+
+    def test_stc_curve(self, tl):
+        tl = np.array([18, 18, 17, 17, 20, 21, 22, 23, 25, 26, 26, 25, 25, 26, 30, 31])
+        calculated = stc_curve(tl)
+        real = np.array([9, 12, 15, 18, 21, 24, 25, 26, 27, 28, 29, 29, 29, 29, 29, 29])
+        assert_array_almost_equal(calculated, real)
+
+    @pytest.mark.parametrize(
+        "freq, vol_density, thickness, theta, c, rho0, expected",
+        [
+            (200, 2000, 0.005, 0, 343, 1.225, 23.514371494),
+            (150, 8000, 0.002, 20, 345, 1.18, 24.827231087),
+            (
+                np.array([200, 150]),
+                8000,
+                0.002,
+                20,
+                345,
+                1.18,
+                np.array([27.319749023, 24.827231087]),
+            ),
+        ],
+    )
+    def test_mass_law(self, freq, vol_density, thickness, theta, c, rho0, expected):
+        calculated = mass_law(freq, vol_density, thickness, theta, c, rho0)
+        assert_array_almost_equal(calculated, expected)
diff --git a/tests/test_cepstrum.py b/tests/test_cepstrum.py
index 6b32c34..40edff4 100644
--- a/tests/test_cepstrum.py
+++ b/tests/test_cepstrum.py
@@ -1,32 +1,32 @@
 import numpy as np
-
-#from scipy.signal import (complex_cepstrum, inverse_complex_cepstrum,
-#                          real_cepstrum, minimum_phase, sawtooth)
 from scipy.signal import sawtooth
-from acoustic_toolbox.cepstrum import *
-
-from numpy.testing import (assert_array_almost_equal)
+from acoustic_toolbox.cepstrum import complex_cepstrum, inverse_complex_cepstrum
+from numpy.testing import assert_array_almost_equal
 
 
-def test_complex_cepstrum():
-    """The period of a periodic harmonic will show up as a peak in a
-    complex cepstrum.
+class TestCepstrum:
+    """
+    Test :mod:`acoustic_toolbox.cepstrum`
     """
-    duration = 5.0
-    fs = 8000.0
-    samples = int(fs * duration)
-    t = np.arange(samples) / fs
-    fundamental = 100.0
-    signal = sawtooth(2. * np.pi * fundamental * t)
-    ceps, _ = complex_cepstrum(signal)
-    assert (fundamental == 1.0 / t[ceps.argmax()])
 
+    def test_complex_cepstrum(self):
+        """The period of a periodic harmonic will show up as a peak in a
+        complex cepstrum.
+        """
+        duration = 5.0
+        fs = 8000.0
+        samples = int(fs * duration)
+        t = np.arange(samples) / fs
+        fundamental = 100.0
+        signal = sawtooth(2.0 * np.pi * fundamental * t)
+        ceps, _ = complex_cepstrum(signal)
+        assert fundamental == 1.0 / t[ceps.argmax()]
 
-def test_inverse_complex_cepstrum():
-    """Applying the complex cepstrum and then the inverse complex cepstrum
-    should result in the original sequence.
-    """
-    x = np.arange(10)
-    ceps, ndelay = complex_cepstrum(x)
-    y = inverse_complex_cepstrum(ceps, ndelay)
-    assert_array_almost_equal(x, y)
+    def test_inverse_complex_cepstrum(self):
+        """Applying the complex cepstrum and then the inverse complex cepstrum
+        should result in the original sequence.
+        """
+        x = np.arange(10)
+        ceps, ndelay = complex_cepstrum(x)
+        y = inverse_complex_cepstrum(ceps, ndelay)
+        assert_array_almost_equal(x, y)
diff --git a/tests/test_criterion.py b/tests/test_criterion.py
index 92535de..56842d9 100644
--- a/tests/test_criterion.py
+++ b/tests/test_criterion.py
@@ -1,39 +1,46 @@
 import numpy as np
 from numpy.testing import assert_array_equal
-
 import pytest
-
 from acoustic_toolbox.criterion import nc_curve, nc
 
+class TestCriterion:
+    """
+    Test :mod:`acoustic_toolbox.criterion`
+    """
 
-@pytest.mark.parametrize("nc, expected", [
-    (15, np.array([47, 36, 29, 22, 17, 14, 12, 11])),
-    (20, np.array([51, 40, 33, 26, 22, 19, 17, 16])),
-    (25, np.array([54, 44, 37, 31, 27, 24, 22, 21])),
-    (30, np.array([57, 48, 41, 35, 31, 29, 28, 27])),
-    (35, np.array([60, 52, 45, 40, 36, 34, 33, 32])),
-    (40, np.array([64, 56, 50, 45, 41, 39, 38, 37])),
-    (45, np.array([67, 60, 54, 49, 46, 44, 43, 42])),
-    (50, np.array([71, 64, 58, 54, 51, 49, 48, 47])),
-    (55, np.array([74, 67, 62, 58, 56, 54, 53, 52])),
-    (60, np.array([77, 71, 67, 63, 61, 59, 58, 57])),
-    (65, np.array([80, 75, 71, 68, 66, 64, 63, 62])),
-    (70, np.array([83, 79, 75, 72, 71, 70, 69, 68])),
-    (11, None),
-    (79, None),
-])
-def test_nc_curve(nc, expected):
-    curve = nc_curve(nc)
-    assert_array_equal(curve, expected)
-
+    @pytest.mark.parametrize("nc, expected", [
+        (15, np.array([47, 36, 29, 22, 17, 14, 12, 11])),
+        (20, np.array([51, 40, 33, 26, 22, 19, 17, 16])),
+        (25, np.array([54, 44, 37, 31, 27, 24, 22, 21])),
+        (30, np.array([57, 48, 41, 35, 31, 29, 28, 27])),
+        (35, np.array([60, 52, 45, 40, 36, 34, 33, 32])),
+        (40, np.array([64, 56, 50, 45, 41, 39, 38, 37])),
+        (45, np.array([67, 60, 54, 49, 46, 44, 43, 42])),
+        (50, np.array([71, 64, 58, 54, 51, 49, 48, 47])),
+        (55, np.array([74, 67, 62, 58, 56, 54, 53, 52])),
+        (60, np.array([77, 71, 67, 63, 61, 59, 58, 57])),
+        (65, np.array([80, 75, 71, 68, 66, 64, 63, 62])),
+        (70, np.array([83, 79, 75, 72, 71, 70, 69, 68])),
+        (11, None),
+        (79, None),
+    ])
+    def test_nc_curve(self, nc, expected):
+        """
+        Test the nc_curve function.
+        """
+        curve = nc_curve(nc)
+        assert_array_equal(curve, expected)
 
-@pytest.mark.parametrize("levels, expected", [
-    (np.array([64, 56, 50, 45, 41, 39, 38, 37]), 40),
-    (np.array([65, 56, 50, 45, 41, 39, 38, 37]), 45),
-    (np.zeros(8), 15),
-    (np.array([82, 78, 74, 71, 70, 69, 68, 67]), 70),
-    (np.array([84, 80, 76, 73, 72, 71, 70, 69]), '70+'),
-])
-def test_nc(levels, expected):
-    calculated = nc(levels)
-    assert calculated == expected
+    @pytest.mark.parametrize("levels, expected", [
+        (np.array([64, 56, 50, 45, 41, 39, 38, 37]), 40),
+        (np.array([65, 56, 50, 45, 41, 39, 38, 37]), 45),
+        (np.zeros(8), 15),
+        (np.array([82, 78, 74, 71, 70, 69, 68, 67]), 70),
+        (np.array([84, 80, 76, 73, 72, 71, 70, 69]), '70+'),
+    ])
+    def test_nc(self, levels, expected):
+        """
+        Test the nc function.
+        """
+        calculated = nc(levels)
+        assert calculated == expected
diff --git a/tests/test_decibel.py b/tests/test_decibel.py
index a81cbda..a9375ac 100644
--- a/tests/test_decibel.py
+++ b/tests/test_decibel.py
@@ -1,25 +1,23 @@
-from acoustic_toolbox.decibel import *
+from acoustic_toolbox.decibel import dbsum, dbmean, dbadd, dbsub, dbmul, dbdiv
+class TestDecibel:
+    """
+    Test :mod:`acoustic_toolbox.decibel`
+    """
 
+    def test_dbsum(self):
+        assert (abs(dbsum([10.0, 10.0]) - 13.0103) < 1e-5)
 
-def test_dbsum():
-    assert (abs(dbsum([10.0, 10.0]) - 13.0103) < 1e-5)
+    def test_dbmean(self):
+        assert (dbmean([10.0, 10.0]) == 10.0)
 
+    def test_dbadd(self):
+        assert (abs(dbadd(10.0, 10.0) - 13.0103) < 1e-5)
 
-def test_dbmean():
-    assert (dbmean([10.0, 10.0]) == 10.0)
+    def test_dbsub(self):
+        assert (abs(dbsub(13.0103, 10.0) - 10.0) < 1e-5)
 
+    def test_dbmul(self):
+        assert (abs(dbmul(10.0, 2) - 13.0103) < 1e-5)
 
-def test_dbadd():
-    assert (abs(dbadd(10.0, 10.0) - 13.0103) < 1e-5)
-
-
-def test_dbsub():
-    assert (abs(dbsub(13.0103, 10.0) - 10.0) < 1e-5)
-
-
-def test_dbmul():
-    assert (abs(dbmul(10.0, 2) - 13.0103) < 1e-5)
-
-
-def test_dbdiv():
-    assert (abs(dbdiv(13.0103, 2) - 10.0) < 1e-5)
+    def test_dbdiv(self):
+        assert (abs(dbdiv(13.0103, 2) - 10.0) < 1e-5)
diff --git a/tests/test_descriptors.py b/tests/test_descriptors.py
index d3f286b..c075f32 100644
--- a/tests/test_descriptors.py
+++ b/tests/test_descriptors.py
@@ -1,8 +1,6 @@
 import pytest
-
 import numpy as np
 from numpy.testing import assert_almost_equal, assert_array_almost_equal
-
 from acoustic_toolbox.descriptors import leq, sel, lw, lden, ldn
 
 @pytest.fixture
@@ -25,61 +23,57 @@ def lnight():
 def power():
     return np.array([1e-3, 1e-5, 1e-7])
 
-def test_leq(levels):
-    calculated = leq(levels)
-    real = 79.806989166
-    assert_almost_equal(calculated, real)
-
-
-def test_leq_int_time(levels):
-    calculated = leq(levels, int_time=1/8)
-    real = 88.837889036
-    assert_almost_equal(calculated, real)
-
-
-def test_sel(levels):
-    calculated = sel(levels)
-    real = 87.588501670
-    assert_almost_equal(calculated, real)
-
-
-def test_lw_int(power):
-    calculated = lw(power[0])
-    real = 90
-    assert calculated == real
-
-
-def test_lw_1darray(power):
-    calculated = lw(power)
-    real = np.array([90, 70, 50])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_lw_1darray_wref(power):
-    calculated = lw(power, Wref=1e-11)
-    real = np.array([80, 60, 40])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_lden_float(lday, levening, lnight):
-    calculated = lden(lday[0], levening[0], lnight[0])
-    real = 77.14095579
-    assert_almost_equal(calculated, real)
-
-
-def test_lden_array(lday, levening, lnight):
-    calculated = lden(lday, levening, lnight)
-    real = np.array([77.14095579, 67.93843392])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_ldn_float(lday, lnight):
-    calculated = ldn(lday[0], lnight[0])
-    real = 77.96703252
-    assert_almost_equal(calculated, real)
-
-
-def test_ldn_array(lday, lnight):
-    calculated = ldn(lday, lnight)
-    real = np.array([77.96703252, 68.71330861])
-    assert_array_almost_equal(calculated, real)
+class TestDescriptors:
+    """
+    Test :mod:`acoustic_toolbox.descriptors`
+    """
+    
+    def test_leq(self, levels):
+        calculated = leq(levels)
+        real = 79.806989166
+        assert_almost_equal(calculated, real)
+
+    def test_leq_int_time(self, levels):
+        calculated = leq(levels, int_time=1/8)
+        real = 88.837889036
+        assert_almost_equal(calculated, real)
+
+    def test_sel(self, levels):
+        calculated = sel(levels)
+        real = 87.588501670
+        assert_almost_equal(calculated, real)
+
+    def test_lw_int(self, power):
+        calculated = lw(power[0])
+        real = 90
+        assert calculated == real
+
+    def test_lw_1darray(self, power):
+        calculated = lw(power)
+        real = np.array([90, 70, 50])
+        assert_array_almost_equal(calculated, real)
+
+    def test_lw_1darray_wref(self, power):
+        calculated = lw(power, Wref=1e-11)
+        real = np.array([80, 60, 40])
+        assert_array_almost_equal(calculated, real)
+
+    def test_lden_float(self, lday, levening, lnight):
+        calculated = lden(lday[0], levening[0], lnight[0])
+        real = 77.14095579
+        assert_almost_equal(calculated, real)
+
+    def test_lden_array(self, lday, levening, lnight):
+        calculated = lden(lday, levening, lnight)
+        real = np.array([77.14095579, 67.93843392])
+        assert_array_almost_equal(calculated, real)
+
+    def test_ldn_float(self, lday, lnight):
+        calculated = ldn(lday[0], lnight[0])
+        real = 77.96703252
+        assert_almost_equal(calculated, real)
+
+    def test_ldn_array(self, lday, lnight):
+        calculated = ldn(lday, lnight)
+        real = np.array([77.96703252, 68.71330861])
+        assert_array_almost_equal(calculated, real)
diff --git a/tests/test_directivity.py b/tests/test_directivity.py
index 13d8969..3120ce2 100644
--- a/tests/test_directivity.py
+++ b/tests/test_directivity.py
@@ -1,14 +1,22 @@
-from acoustic_toolbox.directivity import *
+from acoustic_toolbox.directivity import figure_eight
 import numpy as np
 import pytest
 
 
-@pytest.mark.parametrize("given, expected, uncertainty", [
-    (0.0, 1.0, 0.0),
-    (1. / 2. * np.pi, 0.0, 0.0),
-    (np.pi, +1.0, 0.0),
-    (3. / 2. * np.pi, 0.0, 0.0),
-    (2. * np.pi, +1.0, 0.0),
-])
-def test_figure_eight(given, expected, uncertainty):
-    assert figure_eight(given) == pytest.approx(expected, uncertainty)
+class TestDirectivity:
+    """
+    Test :mod:`acoustic_toolbox.directivity`
+    """
+
+    @pytest.mark.parametrize(
+        "given, expected, uncertainty",
+        [
+            (0.0, 1.0, 0.0),
+            (1.0 / 2.0 * np.pi, 0.0, 0.0),
+            (np.pi, +1.0, 0.0),
+            (3.0 / 2.0 * np.pi, 0.0, 0.0),
+            (2.0 * np.pi, +1.0, 0.0),
+        ],
+    )
+    def test_figure_eight(self, given, expected, uncertainty):
+        assert figure_eight(given) == pytest.approx(expected, uncertainty)
diff --git a/tests/test_generator.py b/tests/test_generator.py
index faf8364..ce94626 100644
--- a/tests/test_generator.py
+++ b/tests/test_generator.py
@@ -3,45 +3,46 @@
 from acoustic_toolbox.generator import noise
 from acoustic_toolbox.signal import octaves
 
-
-class Test_noise():
+parameters = [
+    ('white', +3.0, 0.0),
+    ('pink', 0.0, -3.0),
+    ('blue', +6.0, +3.0),
+    ('brown', -3.0, -6.0),
+    ('violet', +9.0, +6.0),
+]
+# color, power_change, power_density_change
+
+ERROR = 1.0
+"""Permitted error for power_change and power_density_change.
+This value is relatively large for `violet` because of its steep
+inclination. On other cases the error is mostly < 0.1
+"""
+
+@pytest.fixture(params=parameters)
+def parameters(request):
+    return request.param
+
+@pytest.fixture
+def color(parameters):
+    return parameters[0]
+
+@pytest.fixture
+def power_change(parameters):
+    return parameters[1]
+
+@pytest.fixture
+def power_density_change(parameters):
+    return parameters[2]
+
+@pytest.fixture(params=[48000 * 10, 48000 * 10 + 1])
+def samples(request):
+    return request.param
+
+
+class TestNoise():
     """
     Test :func:`acoustic_toolbox.generator.noise`.
     """
-    parameters = [
-        ('white', +3.0, 0.0),
-        ('pink', 0.0, -3.0),
-        ('blue', +6.0, +3.0),
-        ('brown', -3.0, -6.0),
-        ('violet', +9.0, +6.0),
-    ]
-    # color, power_change, power_density_change
-
-    ERROR = 1.0
-    """Permitted error for power_change and power_density_change.
-    This value is relatively large for `violet` because of its steep
-    inclination. On other cases the error is mostly < 0.1
-    """
-
-    @pytest.fixture(params=parameters)
-    def parameters(self, request):
-        return request.param
-
-    @pytest.fixture
-    def color(self, parameters):
-        return parameters[0]
-
-    @pytest.fixture
-    def power_change(self, parameters):
-        return parameters[1]
-
-    @pytest.fixture
-    def power_density_change(self, parameters):
-        return parameters[2]
-
-    @pytest.fixture(params=[48000 * 10, 48000 * 10 + 1])
-    def samples(self, request):
-        return request.param
 
     def test_length(self, color, samples):
 
@@ -52,11 +53,11 @@ def test_power(self, color, samples, power_change):
         fs = 48000
         _, L = octaves(noise(samples, color), fs)
         change = np.diff(L).mean()
-        assert (np.abs(change - power_change) < self.ERROR)
+        assert (np.abs(change - power_change) < ERROR)
 
     def test_power_density(self, color, samples, power_density_change):
 
         fs = 48000
         _, L = octaves(noise(samples, color), fs, density=True)
         change = np.diff(L).mean()
-        assert (np.abs(change - power_density_change) < self.ERROR)
+        assert (np.abs(change - power_density_change) < ERROR)
diff --git a/tests/test_imaging.py b/tests/test_imaging.py
index f5035c0..8247354 100644
--- a/tests/test_imaging.py
+++ b/tests/test_imaging.py
@@ -1,42 +1,34 @@
 import numpy as np
+from acoustic_toolbox.bands import octave, third
+from acoustic_toolbox.imaging import plot_octave, plot_third, plot_bands
 
-import pytest
+class TestImaging:
+    """
+    Test :mod:`acoustic_toolbox.imaging`
+    """
 
-has_matplotlib = pytest.importorskip("matplotlib")
+    octaves = octave(16, 16000)
+    thirds = third(63, 8000)
+    tl_oct = np.array([3, 4, 5, 12, 15, 24, 28, 23, 35, 45, 55])
+    tl_third = np.array([0, 0, 0, 1, 1, 2, 3, 5, 8, 13, 21, 32, 41, 47, 46, 44, 58, 77, 61, 75, 56, 54])
+    title = 'Title'
+    label = 'Label'
 
-if has_matplotlib:
-    from acoustic_toolbox.bands import octave, third
-    from acoustic_toolbox.imaging import plot_octave, plot_third, plot_bands
+    def test_plot_octave(self):
+        plot_octave(self.tl_oct, self.octaves)
 
 
-def setup_module(imaging):
-    imaging.octaves = octave(16, 16000)
-    imaging.thirds = third(63, 8000)
-    imaging.tl_oct = np.array([3, 4, 5, 12, 15, 24, 28, 23, 35, 45, 55])
-    imaging.tl_third = np.array([0, 0, 0, 1, 1, 2, 3, 5, 8, 13, 21, 32, 41, 47, 46, 44, 58, 77, 61, 75, 56, 54])
-    imaging.title = 'Title'
-    imaging.label = 'Label'
+    def test_plot_octave_kHz(self):
+        plot_octave(self.tl_oct, self.octaves, kHz=True, xlabel=self.label, ylabel=self.label, title=self.title, separator='.')
 
 
-def test_plot_octave():
-    plot_octave(tl_oct, octaves)
+    def test_plot_third_octave(self):
+        plot_third(self.tl_third, self.thirds, marker='s', separator=',')
 
 
-def test_plot_octave_kHz():
-    plot_octave(tl_oct, octaves, kHz=True, xlabel=label, ylabel=label, title=title, separator='.')
+    def test_plot_third_octave_kHz(self):
+        plot_third(self.tl_third, self.thirds, marker='s', kHz=True, xlabel=self.label, ylabel=self.label, title=self.title)
 
 
-def test_plot_third_octave():
-    plot_third(tl_third, thirds, marker='s', separator=',')
-
-
-def test_plot_third_octave_kHz():
-    plot_third(tl_third, thirds, marker='s', kHz=True, xlabel=label, ylabel=label, title=title)
-
-
-def test_plot_band_oct():
-    plot_bands(tl_oct, octaves, axes=None, band_type='octave')
-
-
-def teardown_module(imaging):
-    pass
+    def test_plot_band_oct(self):
+        plot_bands(self.tl_oct, self.octaves, axes=None, band_type='octave')
\ No newline at end of file
diff --git a/tests/test_octave.py b/tests/test_octave.py
index ae88c22..65ce65f 100644
--- a/tests/test_octave.py
+++ b/tests/test_octave.py
@@ -6,7 +6,11 @@
 import numpy as np
 
 
-class TestOctave():
+class TestOctave:
+    """
+    Test :class:`acoustic_toolbox.Octave.Octave`.
+    """
+    
     def test_interval(self):
         emin = 1.0
         emax = 4.0
diff --git a/tests/test_power.py b/tests/test_power.py
index 69c5ff3..da51476 100644
--- a/tests/test_power.py
+++ b/tests/test_power.py
@@ -6,16 +6,24 @@
 from acoustic_toolbox.power import lw_iso3746
 
 
-@pytest.mark.parametrize("background_noise, expected", [
-    (79, 91.153934187),
-    (83, 90.187405234),
-    (88, 88.153934187),
-])
-def test_lw_iso3746(background_noise, expected):
-    LpAi = np.array([90, 90, 90, 90])
-    LpAiB = background_noise * np.ones(4)
-    S = 10
-    alpha = np.array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1])
-    surfaces = np.array([10, 10, 10, 10, 10, 10])
-    calculated = lw_iso3746(LpAi, LpAiB, S, alpha, surfaces)
-    assert_almost_equal(calculated, expected)
+class TestPower:
+    """
+    Test :mod:`acoustic_toolbox.power`
+    """
+    
+    @pytest.mark.parametrize(
+        "background_noise, expected",
+        [
+            (79, 91.153934187),
+            (83, 90.187405234),
+            (88, 88.153934187),
+        ],
+    )
+    def test_lw_iso3746(self, background_noise, expected):
+        LpAi = np.array([90, 90, 90, 90])
+        LpAiB = background_noise * np.ones(4)
+        S = 10
+        alpha = np.array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1])
+        surfaces = np.array([10, 10, 10, 10, 10, 10])
+        calculated = lw_iso3746(LpAi, LpAiB, S, alpha, surfaces)
+        assert_almost_equal(calculated, expected)
diff --git a/tests/test_room.py b/tests/test_room.py
index e0a49d8..c023df3 100644
--- a/tests/test_room.py
+++ b/tests/test_room.py
@@ -3,190 +3,189 @@
 
 import pytest
 
-from acoustic_toolbox.room import (mean_alpha, nrc, t60_sabine, t60_eyring, t60_millington, t60_fitzroy, t60_arau, t60_impulse,
-                            c50_from_file, c80_from_file)
+from acoustic_toolbox.room import (
+    mean_alpha,
+    nrc,
+    t60_sabine,
+    t60_eyring,
+    t60_millington,
+    t60_fitzroy,
+    t60_arau,
+    t60_impulse,
+    c50_from_file,
+    c80_from_file,
+)
 from acoustic_toolbox.bands import octave, third
 
-import sys
-sys.path.append('..')
-from get_data_path import data_path
-
-
-def setup_module(room):
-    room.surfaces = np.array([240, 600, 500])
-    room.alpha = np.array([0.1, 0.25, 0.45])
-    room.alpha_bands = np.array([[0.1, 0.1, 0.1, 0.1], [0.25, 0.25, 0.25, 0.25], [0.45, 0.45, 0.45, 0.45]])
-    room.volume = 3000
-
-
-def test_t60_sabine():
-    calculated = t60_sabine(surfaces, alpha, volume)
-    real = 1.211382149
-    assert_almost_equal(calculated, real)
-
-
-def test_t60_sabine_bands():
-    calculated = t60_sabine(surfaces, alpha_bands, volume)
-    real = np.array([1.211382149, 1.211382149, 1.211382149, 1.211382149])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_t60_eyring():
-    calculated = t60_eyring(surfaces, alpha, volume)
-    real = 1.020427763
-    assert_almost_equal(calculated, real)
-
-
-def test_t60_eyring_bands():
-    calculated = t60_eyring(surfaces, alpha_bands, volume)
-    real = np.array([1.020427763, 1.020427763, 1.020427763, 1.020427763])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_t60_millington():
-    calculated = t60_millington(surfaces, alpha, volume)
-    real = 1.020427763
-    assert_almost_equal(calculated, real)
-
-
-def test_t60_millington_bands():
-    calculated = t60_millington(surfaces, alpha_bands, volume)
-    real = np.array([1.020427763, 1.020427763, 1.020427763, 1.020427763])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_t60_fitzroy():
-    surfaces_fitzroy = np.array([240, 240, 600, 600, 500, 500])
-    alpha_fitzroy = np.array([0.1, 0.1, 0.25, 0.25, 0.45, 0.45])
-    calculated = t60_fitzroy(surfaces_fitzroy, alpha_fitzroy, volume)
-    real = 0.699854185
-    assert_almost_equal(calculated, real)
-
-
-def test_t60_fitzroy_bands():
-    surfaces_fitzroy = np.array([240, 240, 600, 600, 500, 500])
-    alpha_bands_f = np.array([[0.1, 0.1, 0.25, 0.25, 0.45, 0.45], [0.1, 0.1, 0.25, 0.25, 0.45, 0.45],
-                              [0.1, 0.1, 0.25, 0.25, 0.45, 0.45]])
-    calculated = t60_fitzroy(surfaces_fitzroy, alpha_bands_f, volume)
-    real = np.array([0.699854185, 0.699854185, 0.699854185])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_t60_arau():
-    Sx = surfaces[0]
-    Sy = surfaces[1]
-    Sz = surfaces[2]
-    calculated = t60_arau(Sx, Sy, Sz, alpha, volume)
-    real = 1.142442931
-    assert_almost_equal(calculated, real)
-
-
-def test_t60_arau_bands():
-    Sx = surfaces[0]
-    Sy = surfaces[1]
-    Sz = surfaces[2]
-    calculated = t60_arau(Sx, Sy, Sz, alpha_bands, volume)
-    real = np.array([1.142442931, 1.142442931, 1.142442931, 1.142442931])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_mean_alpha_float():
-    alpha = 0.1
-    surface = 10
-    calculated = mean_alpha(alpha, surface)
-    real = 0.1
-    assert_almost_equal(calculated, real)
-
-
-def test_mean_alpha_1d():
-    alpha = np.array([0.1, 0.2, 0.3])
-    surfaces = np.array([20, 30, 40])
-    calculated = mean_alpha(alpha, surfaces)
-    real = 0.222222222
-    assert_almost_equal(calculated, real)
-
-
-def test_mean_alpha_bands():
-    alpha = np.array([[0.1, 0.1, 0.1], [0.2, 0.2, 0.2], [0.3, 0.3, 0.3]])
-    surfaces = np.array([20, 30, 40])
-    calculated = mean_alpha(alpha, surfaces)
-    real = np.array([0.222222222, 0.222222222, 0.222222222])
-    assert_array_almost_equal(calculated, real)
-
-
-def test_nrc_1d():
-    alpha = np.array([0.1, 0.25, 0.5, 0.9])
-    calculated = nrc(alpha)
-    real = 0.4375
-    assert_almost_equal(calculated, real)
-
-
-def test_nrc_2d():
-    alphas = np.array([[0.1, 0.2, 0.3, 0.4], [0.4, 0.5, 0.6, 0.7]])
-    calculated = nrc(alphas)
-    real = np.array([0.25, 0.55])
-    assert_array_almost_equal(calculated, real)
-
-
-@pytest.mark.parametrize("file_name, bands, rt, expected", [
-    (data_path() / 'ir_sportscentre_omni.wav', octave(125, 4000), 't30',
-     np.array([7.388, 8.472, 6.795, 6.518, 4.797, 4.089])),
-    (data_path() / 'ir_sportscentre_omni.wav', octave(125, 4000), 'edt',
-     np.array([4.667, 5.942, 6.007, 5.941, 5.038, 3.735])),
-    (data_path() / 'living_room_1.wav', octave(63, 8000), 't30',
-     np.array([0.274, 0.365, 0.303, 0.259, 0.227, 0.211, 0.204, 0.181])),
-    (data_path() / 'living_room_1.wav', octave(63, 8000), 't20',
-     np.array([0.300, 0.365, 0.151, 0.156, 0.102, 0.076, 0.146, 0.152])),
-    (data_path() / 'living_room_1.wav', octave(63, 8000), 't10',
-     np.array([0.185, 0.061, 0.109, 0.024, 0.039, 0.023, 0.105, 0.071])),
-    (data_path() / 'living_room_1.wav', octave(63, 8000), 'edt',
-     np.array([0.267, 0.159, 0.080, 0.037, 0.021, 0.010, 0.022, 0.020])),
-    (data_path() / 'living_room_1.wav', third(100, 5000), 't30',
-     np.array([
-         0.318, 0.340, 0.259, 0.311, 0.267, 0.376, 0.342, 0.268, 0.212, 0.246, 0.211, 0.232, 0.192, 0.231, 0.252, 0.202,
-         0.184, 0.216
-     ])),
-    (data_path() / 'living_room_1.wav', third(100, 5000), 't20',
-     np.array([
-         0.202, 0.383, 0.189, 0.173, 0.141, 0.208, 0.323, 0.221, 0.102, 0.110, 0.081, 0.128, 0.072, 0.074, 0.087, 0.129,
-         0.137, 0.171
-     ])),
-    (data_path() / 'living_room_1.wav', third(100, 5000), 't10',
-     np.array([
-         0.110, 0.104, 0.132, 0.166, 0.135, 0.040, 0.119, 0.223, 0.025, 0.023, 0.047, 0.050, 0.010, 0.017, 0.039, 0.084,
-         0.154, 0.093
-     ])),
-    (data_path() / 'living_room_1.wav', third(100, 5000), 'edt',
-     np.array([
-         0.354, 0.328, 0.284, 0.210, 0.132, 0.116, 0.085, 0.114, 0.064, 0.045, 0.047, 0.047, 0.024, 0.017, 0.016, 0.022,
-         0.020, 0.036
-     ])),
-])
-def test_t60_impulse(file_name, bands, rt, expected):
-    calculated = t60_impulse(file_name, bands, rt)
-    assert_array_almost_equal(calculated, expected, decimal=0)
-
-
-@pytest.mark.parametrize("file_name, bands, expected", [
-    (data_path() / 'living_room_1.wav', octave(63, 8000), np.array([8., 18., 23., 26., 30., 31., 27., 29.])),
-    (data_path() / 'living_room_1.wav', third(100, 5000),
-     np.array([3., 6., 7., 13., 18., 23., 20., 19., 28., 30., 30., 27., 32., 31., 30., 28., 29., 25.])),
-])
-def test_c50_from_file(file_name, bands, expected):
-    calculated = c50_from_file(file_name, bands)
-    assert_array_almost_equal(calculated, expected, decimal=0)
-
-
-@pytest.mark.parametrize("file_name, bands, expected", [
-    (data_path() / 'living_room_1.wav', octave(63, 8000),
-     np.array([18.542, 23.077, 27.015, 31.743, 35.469, 36.836, 33.463, 36.062])),
-    (data_path() / 'living_room_1.wav', third(100, 5000),
-     np.array([17., 14., 17., 24., 26., 27., 22., 26., 34., 35., 34., 32., 38., 38., 34., 34., 35., 32.])),
-])
-def test_c80_from_file(file_name, bands, expected):
-    calculated = c80_from_file(file_name, bands)
-    assert_array_almost_equal(calculated, expected, decimal=0)
-
-
-def teardown_module(room):
-    pass
+from tests.get_data_path import data_path
+
+
+class TestRoom:
+    """
+    Test :mod:`acoustic_toolbox.room`
+    """
+    
+    surfaces = np.array([240, 600, 500])
+    alpha = np.array([0.1, 0.25, 0.45])
+    alpha_bands = np.array(
+        [[0.1, 0.1, 0.1, 0.1], [0.25, 0.25, 0.25, 0.25], [0.45, 0.45, 0.45, 0.45]]
+    )
+    volume = 3000
+
+    def test_t60_sabine(self):
+        calculated = t60_sabine(self.surfaces, self.alpha, self.volume)
+        real = 1.211382149
+        assert_almost_equal(calculated, real)
+
+    def test_t60_sabine_bands(self):
+        calculated = t60_sabine(self.surfaces, self.alpha_bands, self.volume)
+        real = np.array([1.211382149, 1.211382149, 1.211382149, 1.211382149])
+        assert_array_almost_equal(calculated, real)
+
+    def test_t60_eyring(self):
+        calculated = t60_eyring(self.surfaces, self.alpha, self.volume)
+        real = 1.020427763
+        assert_almost_equal(calculated, real)
+
+    def test_t60_eyring_bands(self):
+        calculated = t60_eyring(self.surfaces, self.alpha_bands, self.volume)
+        real = np.array([1.020427763, 1.020427763, 1.020427763, 1.020427763])
+        assert_array_almost_equal(calculated, real)
+
+    def test_t60_millington(self):
+        calculated = t60_millington(self.surfaces, self.alpha, self.volume)
+        real = 1.020427763
+        assert_almost_equal(calculated, real)
+
+    def test_t60_millington_bands(self):
+        calculated = t60_millington(self.surfaces, self.alpha_bands, self.volume)
+        real = np.array([1.020427763, 1.020427763, 1.020427763, 1.020427763])
+        assert_array_almost_equal(calculated, real)
+
+    def test_t60_fitzroy(self):
+        surfaces_fitzroy = np.array([240, 240, 600, 600, 500, 500])
+        alpha_fitzroy = np.array([0.1, 0.1, 0.25, 0.25, 0.45, 0.45])
+        calculated = t60_fitzroy(surfaces_fitzroy, alpha_fitzroy, self.volume)
+        real = 0.699854185
+        assert_almost_equal(calculated, real)
+
+    def test_t60_fitzroy_bands(self):
+        surfaces_fitzroy = np.array([240, 240, 600, 600, 500, 500])
+        alpha_bands_f = np.array(
+            [
+                [0.1, 0.1, 0.25, 0.25, 0.45, 0.45],
+                [0.1, 0.1, 0.25, 0.25, 0.45, 0.45],
+                [0.1, 0.1, 0.25, 0.25, 0.45, 0.45],
+            ]
+        )
+        calculated = t60_fitzroy(surfaces_fitzroy, alpha_bands_f, self.volume)
+        real = np.array([0.699854185, 0.699854185, 0.699854185])
+        assert_array_almost_equal(calculated, real)
+
+    def test_t60_arau(self):
+        Sx = self.surfaces[0]
+        Sy = self.surfaces[1]
+        Sz = self.surfaces[2]
+        calculated = t60_arau(Sx, Sy, Sz, self.alpha, self.volume)
+        real = 1.142442931
+        assert_almost_equal(calculated, real)
+
+    def test_t60_arau_bands(self):
+        Sx = self.surfaces[0]
+        Sy = self.surfaces[1]
+        Sz = self.surfaces[2]
+        calculated = t60_arau(Sx, Sy, Sz, self.alpha_bands, self.volume)
+        real = np.array([1.142442931, 1.142442931, 1.142442931, 1.142442931])
+        assert_array_almost_equal(calculated, real)
+
+    def test_mean_alpha_float(self):
+        alpha = 0.1
+        surface = 10
+        calculated = mean_alpha(alpha, surface)
+        real = 0.1
+        assert_almost_equal(calculated, real)
+
+    def test_mean_alpha_1d(self):
+        alpha = np.array([0.1, 0.2, 0.3])
+        surfaces = np.array([20, 30, 40])
+        calculated = mean_alpha(alpha, surfaces)
+        real = 0.222222222
+        assert_almost_equal(calculated, real)
+
+    def test_mean_alpha_bands(self):
+        alpha = np.array([[0.1, 0.1, 0.1], [0.2, 0.2, 0.2], [0.3, 0.3, 0.3]])
+        surfaces = np.array([20, 30, 40])
+        calculated = mean_alpha(alpha, surfaces)
+        real = np.array([0.222222222, 0.222222222, 0.222222222])
+        assert_array_almost_equal(calculated, real)
+
+    def test_nrc_1d(self):
+        alpha = np.array([0.1, 0.25, 0.5, 0.9])
+        calculated = nrc(alpha)
+        real = 0.4375
+        assert_almost_equal(calculated, real)
+
+    def test_nrc_2d(self):
+        alphas = np.array([[0.1, 0.2, 0.3, 0.4], [0.4, 0.5, 0.6, 0.7]])
+        calculated = nrc(alphas)
+        real = np.array([0.25, 0.55])
+        assert_array_almost_equal(calculated, real)
+
+    @pytest.mark.parametrize("file_name, bands, rt, expected", [
+        (data_path() / 'ir_sportscentre_omni.wav', octave(125, 4000), 't30',
+        np.array([7.388, 8.472, 6.795, 6.518, 4.797, 4.089])),
+        (data_path() / 'ir_sportscentre_omni.wav', octave(125, 4000), 'edt',
+        np.array([4.667, 5.942, 6.007, 5.941, 5.038, 3.735])),
+        (data_path() / 'living_room_1.wav', octave(63, 8000), 't30',
+        np.array([0.274, 0.365, 0.303, 0.259, 0.227, 0.211, 0.204, 0.181])),
+        (data_path() / 'living_room_1.wav', octave(63, 8000), 't20',
+        np.array([0.300, 0.365, 0.151, 0.156, 0.102, 0.076, 0.146, 0.152])),
+        (data_path() / 'living_room_1.wav', octave(63, 8000), 't10',
+        np.array([0.185, 0.061, 0.109, 0.024, 0.039, 0.023, 0.105, 0.071])),
+        (data_path() / 'living_room_1.wav', octave(63, 8000), 'edt',
+        np.array([0.267, 0.159, 0.080, 0.037, 0.021, 0.010, 0.022, 0.020])),
+        (data_path() / 'living_room_1.wav', third(100, 5000), 't30',
+        np.array([
+            0.318, 0.340, 0.259, 0.311, 0.267, 0.376, 0.342, 0.268, 0.212, 0.246, 0.211, 0.232, 0.192, 0.231, 0.252, 0.202,
+            0.184, 0.216
+        ])),
+        (data_path() / 'living_room_1.wav', third(100, 5000), 't20',
+        np.array([
+            0.202, 0.383, 0.189, 0.173, 0.141, 0.208, 0.323, 0.221, 0.102, 0.110, 0.081, 0.128, 0.072, 0.074, 0.087, 0.129,
+            0.137, 0.171
+        ])),
+        (data_path() / 'living_room_1.wav', third(100, 5000), 't10',
+        np.array([
+            0.110, 0.104, 0.132, 0.166, 0.135, 0.040, 0.119, 0.223, 0.025, 0.023, 0.047, 0.050, 0.010, 0.017, 0.039, 0.084,
+            0.154, 0.093
+        ])),
+        (data_path() / 'living_room_1.wav', third(100, 5000), 'edt',
+        np.array([
+            0.354, 0.328, 0.284, 0.210, 0.132, 0.116, 0.085, 0.114, 0.064, 0.045, 0.047, 0.047, 0.024, 0.017, 0.016, 0.022,
+            0.020, 0.036
+        ])),
+    ])
+    def test_t60_impulse(self, file_name, bands, rt, expected):
+        calculated = t60_impulse(file_name, bands, rt)
+        assert_array_almost_equal(calculated, expected, decimal=0)
+
+
+    @pytest.mark.parametrize("file_name, bands, expected", [
+        (data_path() / 'living_room_1.wav', octave(63, 8000), np.array([8., 18., 23., 26., 30., 31., 27., 29.])),
+        (data_path() / 'living_room_1.wav', third(100, 5000),
+        np.array([3., 6., 7., 13., 18., 23., 20., 19., 28., 30., 30., 27., 32., 31., 30., 28., 29., 25.])),
+    ])
+    def test_c50_from_file(self, file_name, bands, expected):
+        calculated = c50_from_file(file_name, bands)
+        assert_array_almost_equal(calculated, expected, decimal=0)
+
+
+    @pytest.mark.parametrize("file_name, bands, expected", [
+        (data_path() / 'living_room_1.wav', octave(63, 8000),
+        np.array([18.542, 23.077, 27.015, 31.743, 35.469, 36.836, 33.463, 36.062])),
+        (data_path() / 'living_room_1.wav', third(100, 5000),
+        np.array([17., 14., 17., 24., 26., 27., 22., 26., 34., 35., 34., 32., 38., 38., 34., 34., 35., 32.])),
+    ])
+    def test_c80_from_file(self, file_name, bands, expected):
+        calculated = c80_from_file(file_name, bands)
+        assert_array_almost_equal(calculated, expected, decimal=0)
diff --git a/tests/test_signal.py b/tests/test_signal.py
index 1508720..f6c507e 100644
--- a/tests/test_signal.py
+++ b/tests/test_signal.py
@@ -1,21 +1,45 @@
 """
 Tests for :func:`acoustic_toolbox.signal`
 """
+
 from acoustic_toolbox.signal import convolve as convolveLTV
 from scipy.signal import convolve as convolveLTI
 import numpy as np
-import itertools
 
-from acoustic_toolbox.signal import *  #decibel_to_neper, neper_to_decibel, ir2fr, zero_crossings
-from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal, assert_approx_equal
+from acoustic_toolbox.signal import (
+    EqualBand,
+    OctaveBand,
+    decibel_to_neper,
+    neper_to_decibel,
+    ir2fr,
+    zero_crossings,
+    integrate_bands,
+    bandpass_octaves,
+    bandpass_third_octaves,
+    bandpass_fractional_octaves,
+    bandpass_frequencies,
+    amplitude_envelope,
+    rms,
+    ms,
+)
+from numpy.testing import assert_array_almost_equal, assert_array_equal
 
 import pytest
 
 
-@pytest.mark.parametrize("u,h", [
-    (np.array([1, 2, 3, 4, 3, 2, 1], dtype='float'), np.array([1, 2, 3, 4], dtype='float')),
-    (np.array([1, 2, 3, 4, 3, 2, 1, 1], dtype='float'), np.array([1, 2, 3, 4, 5], dtype='float')),
-])
+@pytest.mark.parametrize(
+    "u,h",
+    [
+        (
+            np.array([1, 2, 3, 4, 3, 2, 1], dtype="float"),
+            np.array([1, 2, 3, 4], dtype="float"),
+        ),
+        (
+            np.array([1, 2, 3, 4, 3, 2, 1, 1], dtype="float"),
+            np.array([1, 2, 3, 4, 5], dtype="float"),
+        ),
+    ],
+)
 def test_convolve_lti(u, h):
     """Test whether :func:`acoustic_toolbox.signal.convolve` behaves properly when
     performing a convolution with a time-invariant system.
@@ -23,10 +47,14 @@ def test_convolve_lti(u, h):
     H = np.tile(h, (len(u), 1)).T
 
     np.testing.assert_array_almost_equal(convolveLTV(u, H), convolveLTI(u, h))
-    np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='full'), convolveLTI(u, h, mode='full'))
-    np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='valid'), convolveLTI(u, h, mode='valid'))
+    np.testing.assert_array_almost_equal(
+        convolveLTV(u, H, mode="full"), convolveLTI(u, h, mode="full")
+    )
+    np.testing.assert_array_almost_equal(
+        convolveLTV(u, H, mode="valid"), convolveLTI(u, h, mode="valid")
+    )
     # This function and test needs some investigation. Disabling for now.
-    #np.testing.assert_array_almost_equal(convolveLTV(u,H,mode='same'), convolveLTI(u,h,mode='same'))
+    # np.testing.assert_array_almost_equal(convolveLTV(u,H,mode='same'), convolveLTI(u,h,mode='same'))
 
 
 def test_convolve_ltv():
@@ -45,11 +73,11 @@ def test_convolve_ltv():
 
 
 def test_decibel_to_neper():
-    assert (decibel_to_neper(1.0) == 0.11512925464970229)
+    assert decibel_to_neper(1.0) == 0.11512925464970229
 
 
 def test_neper_to_decibel():
-    assert (neper_to_decibel(1.0) == 8.685889638065035)
+    assert neper_to_decibel(1.0) == 8.685889638065035
 
 
 def test_ir2fr():
@@ -60,11 +88,11 @@ def test_ir2fr():
     t = 1.0
     fs = 100.0
     f = 20.0
-    ts = np.arange(0, t, 1. / fs)
+    ts = np.arange(0, t, 1.0 / fs)
 
     A = 5.0
 
-    x = A * np.sin(2. * np.pi * f * ts)
+    x = A * np.sin(2.0 * np.pi * f * ts)
 
     fv, fr = ir2fr(x, fs)
 
@@ -73,7 +101,7 @@ def test_ir2fr():
     assert_array_almost_equal(np.abs(fr).max(), A)
 
 
-class TestEqualBand:  #(unittest.TestCase):
+class TestEqualBand:  # (unittest.TestCase):
     """
     Test :class:`acoustic_toolbox.signal.EqualBand`.
     """
@@ -121,28 +149,25 @@ def test_construction_5(self):
         assert_array_equal(b.center, x)
 
     def test_selection(self):
-
         eb = EqualBand(fstart=0.0, fstop=10.0, nbands=100)
         assert type(eb[3] == type(eb))
         assert type(eb[3:10] == type(eb))
 
 
-class Test_integrate_bands():
+class Test_integrate_bands:
     """
     Test :func:`acoustic_toolbox.signal.test_integrate_bands`.
     """
 
     def test_narrowband_to_octave(self):
-
-        nb = EqualBand(np.arange(100, 900, 200.))
+        nb = EqualBand(np.arange(100, 900, 200.0))
         x = np.ones(len(nb))
-        ob = OctaveBand(([125., 250, 500.]))
+        ob = OctaveBand(([125.0, 250, 500.0]))
         y = integrate_bands(x, nb, ob)
         assert_array_equal(y, np.array([1, 1, 2]))
 
 
 def test_zero_crossings():
-
     duration = 2.0
     fs = 44100.0
     f = 1000.0
@@ -153,15 +178,14 @@ def test_zero_crossings():
     z = zero_crossings(x)
 
     # Amount of zero crossings.
-    assert (len(z) == f * duration * 2)
+    assert len(z) == f * duration * 2
 
     # Position of zero crossings.
     y = np.linspace(0, samples, len(z), endpoint=False).astype(int)
-    assert ((np.abs(z - y) <= 1).all())
+    assert (np.abs(z - y) <= 1).all()
 
 
 def test_ms():
-
     duration = 2.0
     fs = 8000.0
     f = 1000.0
@@ -169,15 +193,14 @@ def test_ms():
     t = np.arange(samples) / fs
     x = np.sin(2.0 * np.pi * f * t)
 
-    assert (np.abs(ms(x) - 0.5) < 1e-9)
+    assert np.abs(ms(x) - 0.5) < 1e-9
 
     x *= 4.0
 
-    assert (np.abs(ms(x) - 8.0) < 1e-9)
+    assert np.abs(ms(x) - 8.0) < 1e-9
 
 
 def test_rms():
-
     duration = 2.0
     fs = 8000.0
     f = 1000.0
@@ -185,11 +208,11 @@ def test_rms():
     t = np.arange(samples) / fs
     x = np.sin(2.0 * np.pi * f * t)
 
-    assert (np.abs(rms(x) - np.sqrt(0.5)) < 1e-9)
+    assert np.abs(rms(x) - np.sqrt(0.5)) < 1e-9
 
     x *= 4.0
 
-    assert (np.abs(rms(x) - np.sqrt(8.0)) < 1e-9)
+    assert np.abs(rms(x) - np.sqrt(8.0)) < 1e-9
 
 
 @pytest.fixture(params=[4000.0, 20000.0, 44100.0])
@@ -208,8 +231,7 @@ def frequency(request):
 
 
 def test_amplitude_envelope(amplitude, frequency, fs):
-    """Test amplitude envelope.
-    """
+    """Test amplitude envelope."""
     duration = 5.0
     samples = int(fs * duration)
     t = np.arange(samples) / fs
@@ -221,23 +243,23 @@ def test_amplitude_envelope(amplitude, frequency, fs):
     # there is also a zero.
     amplitude_determined = np.unique(np.round(out), 6)[0]
 
-    assert (amplitude == amplitude_determined)
+    assert amplitude == amplitude_determined
 
 
-#def test_instantaneous_frequency(amplitude, frequency, fs):
+# def test_instantaneous_frequency(amplitude, frequency, fs):
 
-#duration = 5.0
-#samples = int(fs*duration)
-#t = np.arange(samples) / fs
+# duration = 5.0
+# samples = int(fs*duration)
+# t = np.arange(samples) / fs
 
-#signal = amplitude * np.sin(2.0*np.pi*frequency*t)
+# signal = amplitude * np.sin(2.0*np.pi*frequency*t)
 
-#out = instantaneous_frequency(signal, fs)
+# out = instantaneous_frequency(signal, fs)
 ## Rounding is necessary. We take the first element because occasionally
 ## there is also a zero.
-#frequency_determined = np.unique(np.round(out), 0)
+# frequency_determined = np.unique(np.round(out), 0)
 
-#assert( frequency == frequency_determined )
+# assert( frequency == frequency_determined )
 
 
 @pytest.mark.parametrize("channels", [1, 2, 5])
diff --git a/tests/test_utils.py b/tests/test_utils.py
index c0479b7..c3f8a7a 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -3,94 +3,98 @@
 
 from acoustic_toolbox.utils import esum, _is_1d, mean_tl, wavelength, w
 
+class TestUtils:
+    """
+    Test :mod:`acoustic_toolbox.utils`
+    """
 
-def test_mean_tl_1d():
-    tl = np.array([20, 30, 40, 50])
-    surfaces = np.array([50, 40, 30, 20])
-    tl_real = 24.1116827
-    calculated = mean_tl(tl, surfaces)
-    assert_almost_equal(calculated, tl_real)
+    def test_mean_tl_1d(self):
+        tl = np.array([20, 30, 40, 50])
+        surfaces = np.array([50, 40, 30, 20])
+        tl_real = 24.1116827
+        calculated = mean_tl(tl, surfaces)
+        assert_almost_equal(calculated, tl_real)
 
 
-def test_mean_tl_2d():
-    tl = np.array([[20, 30, 40, 50], [20, 30, 40, 50]])
-    surfaces = np.array([[50, 40, 30, 20], [1, 10, 11, 22]])
-    tl_real = np.array([24.1116827, 33.1466548])
-    calculated = mean_tl(tl, surfaces)
-    assert_array_almost_equal(calculated, tl_real)
+    def test_mean_tl_2d(self):
+        tl = np.array([[20, 30, 40, 50], [20, 30, 40, 50]])
+        surfaces = np.array([[50, 40, 30, 20], [1, 10, 11, 22]])
+        tl_real = np.array([24.1116827, 33.1466548])
+        calculated = mean_tl(tl, surfaces)
+        assert_array_almost_equal(calculated, tl_real)
 
 
-def test_esum_1d():
-    calculated = esum(np.array([90, 90, 90]))
-    real = 94.77121255
-    assert_almost_equal(calculated, real)
+    def test_esum_1d(self):
+        calculated = esum(np.array([90, 90, 90]))
+        real = 94.77121255
+        assert_almost_equal(calculated, real)
 
 
-def test_esum_2d_default_axis():
-    calculated = esum(np.array([[90, 90, 90], [80, 80, 80]]))
-    real = np.array(95.18513939877889)
-    #real = np.array([94.77121255, 84.77121255])
-    assert_array_almost_equal(calculated, real)
+    def test_esum_2d_default_axis(self):
+        calculated = esum(np.array([[90, 90, 90], [80, 80, 80]]))
+        real = np.array(95.18513939877889)
+        #real = np.array([94.77121255, 84.77121255])
+        assert_array_almost_equal(calculated, real)
 
 
-def test_esum_2d_axis0():
-    calculated = esum(np.array([[90, 90, 90], [80, 80, 80]]), axis=0)
-    real = np.array([90.41392685, 90.41392685, 90.41392685])
-    assert_almost_equal(calculated, real)
+    def test_esum_2d_axis0(self):
+        calculated = esum(np.array([[90, 90, 90], [80, 80, 80]]), axis=0)
+        real = np.array([90.41392685, 90.41392685, 90.41392685])
+        assert_almost_equal(calculated, real)
 
 
-def test__is_1d_float():
-    a = 0.9
-    is_float = _is_1d(a)
-    assert a == is_float
+    def test__is_1d_float(self):
+        a = 0.9
+        is_float = _is_1d(a)
+        assert a == is_float
 
 
-def test__is_1d_1darray():
-    a = np.array([0.1, 0.2, 0.3])
-    is_1d_array = _is_1d(a)
-    a_return = np.array([a])
-    assert_array_equal(a_return, is_1d_array)
+    def test__is_1d_1darray(self):
+        a = np.array([0.1, 0.2, 0.3])
+        is_1d_array = _is_1d(a)
+        a_return = np.array([a])
+        assert_array_equal(a_return, is_1d_array)
 
 
-def test__is_1d_2darray():
-    a = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]])
-    is_2d_array = _is_1d(a)
-    assert_array_equal(a, is_2d_array)
+    def test__is_1d_2darray(self):
+        a = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]])
+        is_2d_array = _is_1d(a)
+        assert_array_equal(a, is_2d_array)
 
 
-def test__is1d_vector_2darray():
-    a = np.array([[0.1, 0.2, 0.3]])
-    is_vector_2darray = _is_1d(a)
-    a_return = np.array([0.1, 0.2, 0.3])
-    assert_array_equal(a_return, is_vector_2darray)
+    def test__is1d_vector_2darray(self):
+        a = np.array([[0.1, 0.2, 0.3]])
+        is_vector_2darray = _is_1d(a)
+        a_return = np.array([0.1, 0.2, 0.3])
+        assert_array_equal(a_return, is_vector_2darray)
 
 
-def test_wavelength1():
-    calculated = wavelength(200)
-    quasi = 1.715
-    assert_almost_equal(calculated, quasi)
+    def test_wavelength1(self):
+        calculated = wavelength(200)
+        quasi = 1.715
+        assert_almost_equal(calculated, quasi)
 
 
-def test_wavelength2():
-    calculated = wavelength(200, 343)
-    quasi = 1.715
-    assert_almost_equal(calculated, quasi)
+    def test_wavelength2(self):
+        calculated = wavelength(200, 343)
+        quasi = 1.715
+        assert_almost_equal(calculated, quasi)
 
 
-def test_wavelength3():
-    freqs = np.array([555, 3333, 11111])
-    calculated = wavelength(freqs)
-    quasi = np.array([0.618018018, 0.102910291, 0.030870308])
-    assert_array_almost_equal(calculated, quasi)
+    def test_wavelength3(self):
+        freqs = np.array([555, 3333, 11111])
+        calculated = wavelength(freqs)
+        quasi = np.array([0.618018018, 0.102910291, 0.030870308])
+        assert_array_almost_equal(calculated, quasi)
 
 
-def test_w1():
-    calculated = w(1000)
-    quasi = 6283.185307179
-    assert_almost_equal(calculated, quasi)
+    def test_w1(self):
+        calculated = w(1000)
+        quasi = 6283.185307179
+        assert_almost_equal(calculated, quasi)
 
 
-def test_w2():
-    calculated = w(np.array([1000, 2000, 3000]))
-    quasi = np.array([6283.185307179, 12566.370614359, 18849.555921538])
-    assert_array_almost_equal(calculated, quasi)
+    def test_w2(self):
+        calculated = w(np.array([1000, 2000, 3000]))
+        quasi = np.array([6283.185307179, 12566.370614359, 18849.555921538])
+        assert_array_almost_equal(calculated, quasi)
diff --git a/tests/test_weighting.py b/tests/test_weighting.py
index 0563d42..8261269 100644
--- a/tests/test_weighting.py
+++ b/tests/test_weighting.py
@@ -1,69 +1,66 @@
-import pytest
 import numpy as np
 from numpy.testing import assert_array_equal, assert_array_almost_equal
 
 from acoustic_toolbox.weighting import z2a, a2z, z2c, c2z, a2c, c2a
 
-
-def setup_module(weighting):
-    weighting.levels = 100 * np.ones(33)
-    weighting.lowest = 12.5
-    weighting.highest = 20000
-
-
-def test_z2a():
-    generated = z2a(levels, lowest, highest)
-    real = np.array([
-        36.6, 43.3, 49.5, 55.3, 60.6, 65.4, 69.8, 73.8, 77.5, 80.9, 83.9, 86.6, 89.1, 91.4, 93.4, 95.2, 96.8, 98.1,
-        99.2, 100, 100.6, 101, 101.2, 101.3, 101.2, 101, 100.5, 99.9, 98.9, 97.5, 95.7, 93.4, 90.7
-    ])
-    assert_array_equal(real, generated)
-
-
-def test_a2z():
-    generated = a2z(levels, lowest, highest)
-    real = np.array([
-        163.4, 156.7, 150.5, 144.7, 139.4, 134.6, 130.2, 126.2, 122.5, 119.1, 116.1, 113.4, 110.9, 108.6, 106.6, 104.8,
-        103.2, 101.9, 100.8, 100, 99.4, 99, 98.8, 98.7, 98.8, 99, 99.5, 100.1, 101.1, 102.5, 104.3, 106.6, 109.3
-    ])
-    assert_array_equal(real, generated)
-
-
-def test_z2c():
-    generated = z2c(levels, lowest, highest)
-    real = np.array([
-        88.8, 91.5, 93.8, 95.6, 97, 98, 98.7, 99.2, 99.5, 99.7, 99.8, 99.9, 100, 100, 100, 100, 100, 100, 100, 100, 100,
-        99.9, 99.8, 99.7, 99.5, 99.2, 98.7, 98, 97, 95.6, 93.8, 91.5, 88.8
-    ])
-    assert_array_equal(real, generated)
-
-
-def test_c2z():
-    generated = c2z(levels, lowest, highest)
-    real = np.array([
-        111.2, 108.5, 106.2, 104.4, 103, 102, 101.3, 100.8, 100.5, 100.3, 100.2, 100.1, 100, 100, 100, 100, 100, 100,
-        100, 100, 100, 100.1, 100.2, 100.3, 100.5, 100.8, 101.3, 102, 103, 104.4, 106.2, 108.5, 111.2
-    ])
-    assert_array_equal(real, generated)
-
-
-def test_a2c():
-    generated = a2c(levels, lowest, highest)
-    real = np.array([
-        152.2, 148.2, 144.3, 140.3, 136.4, 132.6, 128.9, 125.4, 122, 118.8, 115.9, 113.3, 110.9, 108.6, 106.6, 104.8,
-        103.2, 101.9, 100.8, 100, 99.4, 98.9, 98.6, 98.4, 98.3, 98.2, 98.2, 98.1, 98.1, 98.1, 98.1, 98.1, 98.1
-    ])
-    assert_array_almost_equal(real, generated)
-
-
-def test_c2a():
-    generated = c2a(levels, lowest, highest)
-    real = np.array([
-        47.8, 51.8, 55.7, 59.7, 63.6, 67.4, 71.1, 74.6, 78, 81.2, 84.1, 86.7, 89.1, 91.4, 93.4, 95.2, 96.8, 98.1, 99.2,
-        100, 100.6, 101.1, 101.4, 101.6, 101.7, 101.8, 101.8, 101.9, 101.9, 101.9, 101.9, 101.9, 101.9
-    ])
-    assert_array_almost_equal(real, generated)
-
-
-def teardown_module(weighting):
-    pass
+class TestWeighting:
+    """
+    Test :mod:`acoustic_toolbox.weighting`
+    """
+
+    levels = 100 * np.ones(33)
+    lowest = 12.5
+    highest = 20000
+
+    def test_z2a(self):
+        generated = z2a(self.levels, self.lowest, self.highest)
+        real = np.array([
+            36.6, 43.3, 49.5, 55.3, 60.6, 65.4, 69.8, 73.8, 77.5, 80.9, 83.9, 86.6, 89.1, 91.4, 93.4, 95.2, 96.8, 98.1,
+            99.2, 100, 100.6, 101, 101.2, 101.3, 101.2, 101, 100.5, 99.9, 98.9, 97.5, 95.7, 93.4, 90.7
+        ])
+        assert_array_equal(real, generated)
+
+
+    def test_a2z(self):
+        generated = a2z(self.levels, self.lowest, self.highest)
+        real = np.array([
+            163.4, 156.7, 150.5, 144.7, 139.4, 134.6, 130.2, 126.2, 122.5, 119.1, 116.1, 113.4, 110.9, 108.6, 106.6, 104.8,
+            103.2, 101.9, 100.8, 100, 99.4, 99, 98.8, 98.7, 98.8, 99, 99.5, 100.1, 101.1, 102.5, 104.3, 106.6, 109.3
+        ])
+        assert_array_equal(real, generated)
+
+
+    def test_z2c(self):
+        generated = z2c(self.levels, self.lowest, self.highest)
+        real = np.array([
+            88.8, 91.5, 93.8, 95.6, 97, 98, 98.7, 99.2, 99.5, 99.7, 99.8, 99.9, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+            99.9, 99.8, 99.7, 99.5, 99.2, 98.7, 98, 97, 95.6, 93.8, 91.5, 88.8
+        ])
+        assert_array_equal(real, generated)
+
+
+    def test_c2z(self):
+        generated = c2z(self.levels, self.lowest, self.highest)
+        real = np.array([
+            111.2, 108.5, 106.2, 104.4, 103, 102, 101.3, 100.8, 100.5, 100.3, 100.2, 100.1, 100, 100, 100, 100, 100, 100,
+            100, 100, 100, 100.1, 100.2, 100.3, 100.5, 100.8, 101.3, 102, 103, 104.4, 106.2, 108.5, 111.2
+        ])
+        assert_array_equal(real, generated)
+
+
+    def test_a2c(self):
+        generated = a2c(self.levels, self.lowest, self.highest)
+        real = np.array([
+            152.2, 148.2, 144.3, 140.3, 136.4, 132.6, 128.9, 125.4, 122, 118.8, 115.9, 113.3, 110.9, 108.6, 106.6, 104.8,
+            103.2, 101.9, 100.8, 100, 99.4, 98.9, 98.6, 98.4, 98.3, 98.2, 98.2, 98.1, 98.1, 98.1, 98.1, 98.1, 98.1
+        ])
+        assert_array_almost_equal(real, generated)
+
+
+    def test_c2a(self):
+        generated = c2a(self.levels, self.lowest, self.highest)
+        real = np.array([
+            47.8, 51.8, 55.7, 59.7, 63.6, 67.4, 71.1, 74.6, 78, 81.2, 84.1, 86.7, 89.1, 91.4, 93.4, 95.2, 96.8, 98.1, 99.2,
+            100, 100.6, 101.1, 101.4, 101.6, 101.7, 101.8, 101.8, 101.9, 101.9, 101.9, 101.9, 101.9, 101.9
+        ])
+        assert_array_almost_equal(real, generated)