code: def test_persyst_dates(tmp_path):
      """Test different Persyst date formats for meas date."""
      # now test what if you change contents of the lay file
      new_fname_lay = tmp_path / fname_lay.name
      new_fname_dat = tmp_path / fname_dat.name
      shutil.copy(fname_dat, new_fname_dat)
  
      # reformat the lay file to have testdate with
      # "/" character
      with open(fname_lay) as fin:
          with open(new_fname_lay, "w") as fout:
              # for each line in the input file
              for idx, line in enumerate(fin):
                  if line.startswith("TestDate"):
                      line = "TestDate=01/23/2000\n"
                  fout.write(line)
      # file should update correctly with datetime
      raw = read_raw_persyst(new_fname_lay)
      assert raw.info["meas_date"].month == 1
      assert raw.info["meas_date"].day == 23
      assert raw.info["meas_date"].year == 2000
  
      # reformat the lay file to have testdate with
      # "-" character
      os.remove(new_fname_lay)
      with open(fname_lay) as fin:
          with open(new_fname_lay, "w") as fout:
              # for each line in the input file
              for idx, line in enumerate(fin):
                  if line.startswith("TestDate"):
                      line = "TestDate=24-01-2000\n"
                  fout.write(line)
      # file should update correctly with datetime
      raw = read_raw_persyst(new_fname_lay)
      assert raw.info["meas_date"].month == 1
      assert raw.info["meas_date"].day == 24
      assert raw.info["meas_date"].year == 2000
  
file_path: mne-python/mne/io/persyst/tests/test_persyst.py
imports: import os
  import shutil
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne.datasets.testing import data_path, requires_testing_data
  from mne.io import read_raw_persyst
  from mne.io.tests.test_raw import _test_raw_reader
label_desc: Use image node_id 3 for calling a global function with example usage: test_persyst_dates(tmp_path) without return types