code: def test_val_check_interval(tmpdir, max_epochs, denominator):
      class TestModel(BoringModel):
          def __init__(self):
              super().__init__()
              self.train_epoch_calls = 0
              self.val_epoch_calls = 0
  
          def on_train_epoch_start(self) -> None:
              self.train_epoch_calls += 1
  
          def on_validation_epoch_start(self) -> None:
              if not self.trainer.sanity_checking:
                  self.val_epoch_calls += 1
  
      model = TestModel()
      trainer = Trainer(
          max_epochs=max_epochs,
          val_check_interval=1 / denominator,
          logger=False,
      )
      trainer.fit(model)
  
      assert model.train_epoch_calls == max_epochs
      assert model.val_epoch_calls == max_epochs * denominator
  
file_path: pytorch-lightning/tests/tests_pytorch/trainer/flags/test_val_check_interval.py
imports: import logging
  import pytest
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset, RandomIterableDataset
  from lightning.pytorch.trainer.trainer import Trainer
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch.utils.data import DataLoader
label_desc: Use image node_id 1 for calling a global function with example usage: test_val_check_interval(tmpdir, max_epochs, denominator) without return types