Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: use fixture and parametrize in BrainVision date tests #6623

Merged
merged 8 commits into from
Aug 5, 2019

Conversation

sappelhoff
Copy link
Member

fixes #6611 (comment)

  • saving space
  • saving computation time
  • hopefully also more obvious
  • even an additional test

@sappelhoff sappelhoff requested review from larsoner and massich August 2, 2019 13:01
@massich
Copy link
Contributor

massich commented Aug 2, 2019

  • 34 lines and - 233 lines !!!!!! Those are the good PRs!! (+ we remove files from the codebase) All the kudos to @sappelhoff

There's only a couple things:
1 - this code no longer tests the intermediate representation of the date.
2 - I think this parametrization is not that readable.

I would be fine in merging this as is (if the tmpdir is not an issue and the CIs are happy).

But I would like to try to move the logic from the parametrization to the fixture. (at least as sport to see if it's more readable). I can give it a shot after #6621

massich
massich previously approved these changes Aug 2, 2019
@massich massich self-requested a review August 2, 2019 13:45
@massich massich dismissed their stale review August 2, 2019 13:45

I'll add some nitpicks

mne/io/brainvision/tests/test_brainvision.py Outdated Show resolved Hide resolved
mne/io/brainvision/tests/test_brainvision.py Outdated Show resolved Hide resolved
@massich
Copy link
Contributor

massich commented Aug 2, 2019

@sappelhoff have you checked how other projects mock files? It might be worth to take a look.

@GuillaumeFavelier
Copy link
Contributor

A good chunk has been removed down there indeed, good work. 👍

massich
massich previously requested changes Aug 2, 2019
mne/io/brainvision/tests/test_brainvision.py Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 2, 2019

Codecov Report

Merging #6623 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master   #6623      +/-   ##
=========================================
- Coverage   89.41%   89.4%   -0.01%     
=========================================
  Files         416     416              
  Lines       75140   75119      -21     
  Branches    12347   12352       +5     
=========================================
- Hits        67184   67163      -21     
- Misses       5123    5124       +1     
+ Partials     2833    2832       -1

@massich
Copy link
Contributor

massich commented Aug 2, 2019

@sappelhoff I made you a PR sappelhoff#2

@massich
Copy link
Contributor

massich commented Aug 2, 2019 via email

import os.path as op
from os import unlink
from collections import OrderedDict as odict
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid changing names of builtin objects. It makes your code harder to read. I hard to scroll the file to understand the code below

@sappelhoff
Copy link
Member Author

@massich can you help me? I have no clue about this Travis error ...

@massich
Copy link
Contributor

massich commented Aug 3, 2019

Travis is breaking for the python 3.5 environment. Most likely to be backward compat we need a casting. I tried but I runned into #6627.

@massich
Copy link
Contributor

massich commented Aug 3, 2019

I've no idea what is running in travis. In my system the problem was that ordered dict was not doing what you wrote. The order of construction was not presreved.

So I just changed this :

-    return OrderedDict(vhdr_fname=vhdr_fname, vmrk_fname=vmrk_fname,
-                       lines=lines)
+    return vhdr_fname, vmrk_fname, lines
...
-    vhdr_fname, vmrk_fname, lines = _mocked_meas_date_data.values()
+    vhdr_fname, vmrk_fname, lines = _mocked_meas_date_data
...
-    yield OrderedDict(vhdr_fname=vhdr_fname,
-                      expected_meas_date=request.param['meas_date'],
-                      expected_meas_date_repr=request.param['meas_date_repr'])
+    yield (
+        vhdr_fname, request.param['meas_date'], request.param['meas_date_repr']
+    )
...
-    vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
+    vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file

Her is a full trace showing my system, the error and the fix behavior:

click me
~/code/mne-python base*
(mne35) ❯ python -c "import mne; mne.sys_info()"                               
Platform:      Linux-4.15.0-46-generic-x86_64-with-debian-buster-sid
Python:        3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:43)  [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]
Executable:    /home/sik/miniconda3/envs/mne35/bin/python
CPU:           x86_64: 4 cores
Memory:        Unavailable (requires "psutil" package)
mne:           0.19.dev0
numpy:         1.11.2 {lapack=/home/sik/miniconda3/envs/mne35/include, blas=/home/sik/miniconda3/envs/mne35/include}
scipy:         0.17.1
matplotlib:    1.5.3 {backend=Qt5Agg}

sklearn:       0.18.1
nibabel:       Not found
mayavi:        Not found
cupy:          Not found
pandas:        0.18.0
dipy:          Not found

~/code/mne-python base
(mne35) ❯ git checkout base~1                   
Note: checking out 'base~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 9af8872c0 squash 6623

~/code/mne-python 9af8872...
(mne35) ❯ pytest ./mne/io/brainvision/tests/test_brainvision.py -k meas_date -v
Test session starts (platform: linux, Python 3.5.5, pytest 3.8.1, pytest-sugar 0.9.2)
cachedir: .pytest_cache
rootdir: /home/sik/code/mne-python, inifile: setup.cfg
plugins: sugar-0.9.2, faulthandler-1.5.0, cov-2.6.0


―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file0] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', '2013-11-13 16:14:03 GM'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', [1384359243, 794231])])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = [1384359243, 794231]
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', '2013-11-13 16:14:03 GM'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', [1384359243, 794231])])
vhdr_f     = '2013-11-13 16:14:03 GM'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/2013-11-13 16:14:03 GM', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/2013-11-13 16:14:03 GM'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0] ⨯                                                                        14% █▌        

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file1] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', '2007-07-16 12:22:40 GM'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', [1184588560, 937453])])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = [1184588560, 937453]
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', '2007-07-16 12:22:40 GM'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', [1184588560, 937453])])
vhdr_f     = '2007-07-16 12:22:40 GM'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/2007-07-16 12:22:40 GM', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/2007-07-16 12:22:40 GM'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1] ⨯                                                                        29% ██▉       

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file2] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', '2007-07-16 12:22:40 GM'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', [1184588560, 937453])])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = [1184588560, 937453]
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', '2007-07-16 12:22:40 GM'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', [1184588560, 937453])])
vhdr_f     = '2007-07-16 12:22:40 GM'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/2007-07-16 12:22:40 GM', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/2007-07-16 12:22:40 GM'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2] ⨯                                                                        43% ████▍     

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file3] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = None
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])
vhdr_f     = 'unspecified'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/unspecified', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/unspecified'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3] ⨯                                                                        57% █████▊    

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file4] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = None
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])
vhdr_f     = 'unspecified'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/unspecified', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/unspecified'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4] ⨯                                                                        71% ███████▎  

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file5] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = None
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])
vhdr_f     = 'unspecified'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/unspecified', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/unspecified'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5] ⨯                                                                        86% ████████▋ 

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_meas_date[mocked_meas_date_file6] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])

    def test_meas_date(mocked_meas_date_file):
        """Test successful extraction of measurement date."""
        vhdr_f, expected_meas, expected_meas_repr = mocked_meas_date_file.values()
>       raw = read_raw_brainvision(vhdr_f)

expected_meas = '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'
expected_meas_repr = None
mocked_meas_date_file = OrderedDict([('expected_meas_date_repr', 'unspecified'), ('vhdr_fname', '/tmp/pytest-of-sik/pytest-40/brainvision_mocked_meas_date0/test.vhdr'), ('expected_meas_date', None)])
vhdr_f     = 'unspecified'

mne/io/brainvision/tests/test_brainvision.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne/io/brainvision/brainvision.py:824: in read_raw_brainvision
    verbose=verbose)
</home/sik/code/mne-python/mne/externals/decorator.py:decorator-gen-146>:2: in __init__
    ???
mne/utils/_logging.py:89: in wrapper
    return function(*args, **kwargs)
mne/io/brainvision/brainvision.py:68: in __init__
    orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale, montage)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vhdr_fname = '/home/sik/code/mne-python/unspecified', eog = ('HEOGL', 'HEOGR', 'VEOGb'), misc = 'auto', scale = 1.0, montage = 'deprecated'

    def _get_vhdr_info(vhdr_fname, eog, misc, scale, montage):
        """Extract all the information from the header file.
    
        Parameters
        ----------
        vhdr_fname : str
            Raw EEG header to be read.
        eog : list of str
            Names of channels that should be designated EOG channels. Names should
            correspond to the vhdr file.
        misc : list or tuple of str | 'auto'
            Names of channels or list of indices that should be designated
            MISC channels. Values should correspond to the electrodes
            in the vhdr file. If 'auto', units in vhdr file are used for inferring
            misc channels. Default is ``'auto'``.
        scale : float
            The scaling factor for EEG data. Unless specified otherwise by
            header file, units are in microvolts. Default scale factor is 1.
        montage : str | None | instance of Montage
            Path or instance of montage containing electrode positions. If None,
            read sensor locations from header file if present, otherwise (0, 0, 0).
            See the documentation of :func:`mne.channels.read_montage` for more
            information.
    
        Returns
        -------
        info : Info
            The measurement info.
        data_fname : str
            Path to the binary data file.
        fmt : str
            The format of the binary data file.
        order : str
            Orientation of the binary data.
        n_samples : int
            Number of data points in the binary data file.
        mrk_fname : str
            Path to the marker file.
        montage : Montage
            Coordinates of the channels, if present in the header file.
        orig_units : dict
            Dictionary mapping channel names to their units as specified in
            the header file. Example: {'FC1': 'nV'}
        """
        scale = float(scale)
        ext = op.splitext(vhdr_fname)[-1]
        if ext != '.vhdr':
            raise IOError("The header file must be given to read the data, "
>                         "not a file with extension '%s'." % ext)
E           OSError: The header file must be given to read the data, not a file with extension ''.

eog        = ('HEOGL', 'HEOGR', 'VEOGb')
ext        = ''
misc       = 'auto'
montage    = 'deprecated'
scale      = 1.0
vhdr_fname = '/home/sik/code/mne-python/unspecified'

mne/io/brainvision/brainvision.py:437: OSError

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6] ⨯                                                                       100% ██████████^C
------------------------------------------------------ generated xml file: /home/sik/code/mne-python/junit-results.xml ------------------------------------------------------
========================================================================== short test summary info ==========================================================================
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2]
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3]
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]
FAIL mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
========================================================================= slowest 20 test durations =========================================================================
0.21s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2]
0.00s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/home/sik/miniconda3/envs/mne35/lib/python3.5/site-packages/coverage/parser.py:543: KeyboardInterrupt
(to show a full traceback on KeyboardInterrupt use --fulltrace)

Results (6.81s):
       7 failed
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file0]
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file1]
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file2]
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file3]
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file4]
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file5]
         - mne/io/brainvision/tests/test_brainvision.py:139 test_meas_date[mocked_meas_date_file6]
      15 deselected
^C

~/code/mne-python 9af8872... 8s
(mne35) ❯ git ceckout base                                                     
git: 'ceckout' is not a git command. See 'git --help'.

The most similar command is
	checkout

~/code/mne-python 9af8872...
(mne35) ❯ git checkout base  
Previous HEAD position was 9af8872c0 squash 6623
Switched to branch 'base'

~/code/mne-python base
(mne35) ❯ pytest ./mne/io/brainvision/tests/test_brainvision.py -k meas_date -v
Test session starts (platform: linux, Python 3.5.5, pytest 3.8.1, pytest-sugar 0.9.2)
cachedir: .pytest_cache
rootdir: /home/sik/code/mne-python, inifile: setup.cfg
plugins: sugar-0.9.2, faulthandler-1.5.0, cov-2.6.0

 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0] ✓                                                                        14% █▌        
 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1] ✓                                                                        29% ██▉       
 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2] ✓                                                                        43% ████▍     
 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3] ✓                                                                        57% █████▊    
 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4] ✓                                                                        71% ███████▎  
 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5] ✓                                                                        86% ████████▋ 
 mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6] ✓                                                                       100% ██████████
------------------------------------------------------ generated xml file: /home/sik/code/mne-python/junit-results.xml ------------------------------------------------------


========================================================================= slowest 20 test durations =========================================================================
0.21s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2]
0.01s call     mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file2]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file6]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
0.00s setup    mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file3]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file1]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file4]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file0]
0.00s teardown mne/io/brainvision/tests/test_brainvision.py::test_meas_date[mocked_meas_date_file5]

Results (14.05s):
       7 passed
      15 deselected

~/code/mne-python base 15s
(mne35) ❯ 

@sappelhoff
Copy link
Member Author

Thanks @massich

Do you know about the <details></details> HTML tag? It can make the thread more readable if you want to paste a lot of stuff (e.g. error logs)

If you have a big chunk of code, simply wrap it like so:

<details><summary> My summary </summary>

~~~
my code goes here
~~~
</details>

Rendered:

My summary
my code goes here

@massich
Copy link
Contributor

massich commented Aug 3, 2019 via email

Copy link
Contributor

@massich massich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. merging now.

@massich massich merged commit 07e605f into mne-tools:master Aug 5, 2019
@sappelhoff sappelhoff deleted the bvtests branch August 5, 2019 10:00
alexrockhill pushed a commit to alexrockhill/mne-python that referenced this pull request Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants