Skip to content

Commit

Permalink
Pytest ignore warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulay committed Sep 24, 2024
1 parent fc12136 commit ce7edc0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ packages = ["src/ezmsg"]
dev-dependencies = [
"ruff>=0.6.7",
]

[tool.pytest.ini_options]
norecursedirs = "tests/helpers"
addopts = "-p no:warnings"
10 changes: 5 additions & 5 deletions tests/test_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ def test_spectrum_vs_sps_fft(complex: bool):
assert np.allclose(test_spec, sp_res)


class TestSpectrumSettings(ez.Settings):
class SpectrumSettingsTest(ez.Settings):
synth_settings: EEGSynthSettings
window_settings: WindowSettings
spectrum_settings: SpectrumSettings
log_settings: MessageLoggerSettings
term_settings: TerminateOnTotalSettings = field(default_factory=TerminateOnTotalSettings)


class TestSpectrumIntegration(ez.Collection):
SETTINGS = TestSpectrumSettings
class SpectrumIntegrationTest(ez.Collection):
SETTINGS = SpectrumSettingsTest

SOURCE = EEGSynth()
WIN = Window()
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_spectrum_system(
test_filename = get_test_fn(test_name)
ez.logger.info(test_filename)

settings = TestSpectrumSettings(
settings = SpectrumSettingsTest(
synth_settings=EEGSynthSettings(
fs=fs,
n_time=n_time,
Expand All @@ -246,7 +246,7 @@ def test_spectrum_system(
total=target_messages,
)
)
system = TestSpectrumIntegration(settings)
system = SpectrumIntegrationTest(settings)
ez.run(SYSTEM=system)

messages: typing.List[AxisArray] = [_ for _ in message_log(test_filename)]
Expand Down
10 changes: 5 additions & 5 deletions tests/test_synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ def f_test(t): return amp * np.sin(2 * np.pi * freq * t + phase)
# TODO: test SinGenerator in a system.


class TestEEGSynthSettings(ez.Settings):
class EEGSynthSettingsTest(ez.Settings):
synth_settings: EEGSynthSettings
log_settings: MessageLoggerSettings
term_settings: TerminateOnTotalSettings = field(default_factory=TerminateOnTotalSettings)


class TestEEGSynthIntegration(ez.Collection):
SETTINGS = TestEEGSynthSettings
class EEGSynthIntegrationTest(ez.Collection):
SETTINGS = EEGSynthSettingsTest

SOURCE = EEGSynth()
SINK = MessageLogger()
Expand Down Expand Up @@ -345,7 +345,7 @@ def test_eegsynth_system(
test_filename = get_test_fn(test_name)
ez.logger.info(test_filename)

settings = TestEEGSynthSettings(
settings = EEGSynthSettingsTest(
synth_settings=EEGSynthSettings(
fs=fs,
n_time=n_time,
Expand All @@ -360,7 +360,7 @@ def test_eegsynth_system(
)
)

system = TestEEGSynthIntegration(settings)
system = EEGSynthIntegrationTest(settings)
ez.run(SYSTEM=system)

messages: typing.List[AxisArray] = [_ for _ in message_log(test_filename)]
Expand Down

0 comments on commit ce7edc0

Please sign in to comment.