Skip to content

FutureWarning: split() requires a non-empty pattern match #29

@pllim

Description

@pllim

I found this while investigating astropy/astropy#7928 by:

  • Un-silencing warnings in pytest.
  • Turn warnings into exception (except for ImportWarning from Cython, which I ignored still).
  • Run tests on coordinates (saw this in convolution too).
__________________ [doctest] docs/coordinates/solarsystem.rst __________________
.../pytest_doctestplus/plugin.py:122: in runtest
    raise_on_error=True, verbose=False, encoding='utf-8')
.../doctest.py:2073: in testfile
    test = parser.get_doctest(text, globs, name, filename, 0)
.../doctest.py:669: in get_doctest
    return DocTest(self.get_examples(string, name), globs,
.../doctest.py:683: in get_examples
    return [x for x in self.parse(string, name)
.../pytest_doctestplus/plugin.py:192: in parse
    required = re.split(r'\s*,?\s*', match.group(1))
.../re.py:212: in split
    return _compile(pattern, flags).split(string, maxsplit)
E   FutureWarning: split() requires a non-empty pattern match.

https://github.com/astropy/pytest-doctestplus/blob/6703a182cf931968b5a9f2ac1949059270a88002/pytest_doctestplus/plugin.py#L213-L214

Here is my pytest header:

platform linux -- Python 3.6.4, pytest-3.2.1, py-1.4.34, pluggy-0.4.0

Running tests with Astropy version 3.1.dev22915.
Running tests in astropy/coordinates docs/coordinates.

Date: 2018-10-26T15:57:40

Platform: Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-redhat-7.5-Maipo

Executable: .../envs/py36/bin/python

Full Python Version: 
3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) 
[GCC 7.2.0]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.15.2
Scipy: 1.1.0
Matplotlib: 2.2.2
h5py: 2.8.0
Pandas: 0.20.3
Asdf: 2.0.1
Cython: 0.26.1
astropy_helpers: 2.0.6
Using Astropy options: remote_data: any.

PyQt5 5.6 -- Qt runtime 5.6.2 -- Qt compiled 5.6.2
rootdir: /tmp/astropy-test-woysnyxx/lib/python3.6/site-packages, inifile: setup.cfg
plugins: xdist-1.17.1, qt-2.4.1, openfiles-0.2.0, mpl-0.8, flake8-0.8.1, doctestplus-0.1.2, arraydiff-0.1, remotedata-0.2.2.dev0, ci-watson-0.0.0.dev33+gdec4b009

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions